Anybody else tried?
Ranjan bhai very good. you are genius…
My way is little generic…. So that is can be used for querying in the table as well.
with t(Indx,Char,Word)
as
(
select 1 Indx,cast(LEFT (Emp,1) as varchar(50)) Char,Emp Word from (select 'Employee' Emp) a
union all
select Indx + 1 I, cast(Right(LEFT(Word,Indx+1),1) as varchar(50)) Char,Word from t where LEN(Word) > Indx
)select * from t where Char = 'E';
From: ranjan...@thomsonreuters.com [mailto:ranjan...@thomsonreuters.com]
Sent: 05 October 2012 02:56
To: Pramod Jamadagni; mus...@planwell.com; balachandra...@genpact.com
Subject: RE: Write an sql to....
with cte(i) as
(
Select i=CHARINDEX ('E','Employee')
union all
Select i=CHARINDEX ('E','Employee',i+1) from cte where i<>0
)
select * from cte where i>0
From: Pramod Jamadagni [mailto:Pramod.J...@Indecomm.net]
Sent: Friday, October 05, 2012 12:36 PM
To: mus...@planwell.com; Kalita, Ranjan (Financial&Risk);
balachandra...@genpact.com
Subject: Write an sql to....
Guys,
Can someone send me a query to know the position of the letter say “E” in the word “Employee” which would be 1st,7th,8th.
Thanks,
PRamod.
Hum kaha genius hai woh to aap haiJ
Jokes apart Mr. Ranjan
Let me know if there is any other approach. “Jeevo bheda gaNah” mean everybody think differently in this world J.