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
Answer Posted / 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 |
Post New Answer View All Answers
What is substr in informatica?
Sequence generator, when you move from develoment to production how will you reset
Explain pmcmd command usage in informatica
How to elaborate powercenter integration service?
How to differentiate between the active and passive transformations?
How many ways are there to do 'remove duplicate records in informatica'?
What is a repository? And how to add it in an informatica client?
What are the basic requirements to join two sources in a source qualifier transformation using default join?
What is a joiner transformation?
What do you mean by channel change?
What is domain and gateway node?
Differentiate between a repository server and a powerhouse?
How to extract the informatica rejected data?
How do you load first and last records into target table? How many ways are there to do it? Explain through mapping flows.
-Which expression we can not use in Maplets?, -Can we join(relate) two dimensions in a schema? -Why and where we use 'sorted input' option?