write sql query following table
city gender no
chennai male 40
chennai female 35
bangalore male 25
bangalore female 25
mumbai female 15
i want the required output
city male female
chennai 40 35
bangalore 25 25
mumbai 15
Answers were Sorted based on User's Feedback
Answer / venky
select city,sum(c1) male,sum(c2) female from(select
city,decode(gender,'male',no,0)
c1,decode(gender,'female',no,0) c2 from tablename) tablename
group by city;
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / sudheer
Select ABC.CITY AS CITY, sum(ABC.male) as MALE, sum(ABC.Female) as FEMALE from
(
select city, Sum(no) as male, NULL AS female from table_name
where gender = 'male'
Group by city
UNION
select city, NULL as male, SUM(no) AS female from table_name
where gender = 'female'
Group by city
) ABC Group by CITY
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / anshita gupta
select * from city pivot(max(no) for gender in('male ','female'));
| Is This Answer Correct ? | 0 Yes | 0 No |
what is tha tracesing level? and difference betweentrace in normal and verbose and nonverbose?
what happens if you try to create a shortcut to a non- shared folder?
Hi, I have one flatfile as target in a mapping . When i am trying to load data second time into it. The records already is in flatfile is getting override. I don't want to override existing records. Note : we can do this by implementing CDC / Incremental pool logic if target is relational . But this is flatfile. So, even i use this same technique it will override only So what is the solution ? Is there any option at session level for flatfile target ? Advance Thanks
I cleared Informatica certification Designer. if anybody need dumps, can contact at mukesh1009@gmail.com
119 Answers Accenture, Gcs, TCS,
In EMP table, for those emp whose Hiredate is same, update their sal by "sal+500" or else for others keep the sal as it is, how to do it by SQL query
what is update strategy transformation ?
checkout and checkin in informatica 8.6
how to load duplicate row in a target
Diffrence between static and dynamic cache
EXL informatica Questions
hi all, I have to do Informatica Certification? Can any body send me Some Informatica Certification Dumps/FAQS ? Advance Thanks... Send me----: raghukrams@yahoo.com
What are partitions in informatica and which one is used for better performance?