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
Repository user profiles
Different qualification between a related rotate toward the sky and isolates look upward?
Differentiate between source qualifier and filter transformation?
How to load last n records of file into target table - informatica
How to create the source and target database connections in server manager?
What are the transformations that are not supported in mapplet?
What are the different types of transformation available in informatica.
Hi friends I want to know about what r the dimensions in the banking porjects and genarally how many tables r in project ?
How an expression transformation differs from aggregator transformation?
what is SDLC way of code development?
Why sorter is an active transformation?
Can anyone tell me the new features in Informatica 9 Version?
How to load the name of the current processing flat file along with the data into the target using informatica mapping?
What is the difference between informatics 7x and 8x and what is latest version?
source : xml file target: xml file how can we check data loaded into target xml file using writing sql query. pls help on this asap.