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
How to create a non-reusable instance of reusable transformations?
How to load a Dimension ? and how to load a fact table?
How to elaborate tracing level?
Quickly characterize reusable change?
How would you copy the content of one repository to another repository?
What are junk dimensions?
Design time, run time. If you don't create parameter what will happen
Design a mapping to load the cumulative sum of salaries of employees into target table?
Which means the first record should come as last record and last record should come as first record and load into the target file?
What is meant by lookup transformation? Explain the types of lookup transformation?
Name the different lookup cache(s)?
What is joiner change?
What is meant by query override?
What is data caches/ index caches?
What are the main features of Oracle 8i with context to datawarehouse?