devaraya
Default port
Points: 1455
More actions
June 19, 2007 at 7:06 am
#117511
Hi Sql Guru's,
I have a table like this
eno ename Gender
01 xx Male
02 yy Female
03 zz Male
How can i get like this through query?
eno ename Male Female
Thanks in Advance
Ramaa
-=JLK=-
SSCertifiable
Points: 5315
June 19, 2007 at 7:34 am
#713835
Use a Case statement on the data in gender for the new columns. For example:
select
eno, ename, (case gender when 'Male' then 'Male' else '' end) as Male,
(case gender when 'Female' then 'Female' else '' end) as Female
from mytable_
--James.
June 19, 2007 at 7:42 am
#713836
Hi James,
Thank You very much. It works fine for me.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply