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 / chanakya

SELECT CITY,
SUM(DECODE(GENDER,'MALE',NO)) MALE ,
SUM(DECODE(GENDER,'FEMALE',NO)) FEMALE
FROM TABLE_NAME GROUP BY CITY

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the best practices to extract data from flat file source which are bigger than 100 mb memory?

1925


What is sequence generator transformation in informatica?

633


What is the fact table?

597


Performance tuning in UNIX for informatica mappings?

2154


hi friends ... i have insurance project(informatica),can you please tell me how many table and mappings we need to use?and explain me.. thank you

9172






What is a sorter transformation?

670


What is sq transformation?

675


Explain what transformation and how many are there in informatica?

499


What are ETL Tools?

675


How to create or implement slowly changing dimension (SCD) Type 2 Effective Date mapping in informatica/Flagging mapping in informatica/visioning mapping in informatica?

718


What can we do to improve the performance of informatica aggregator transformation?

624


Hi, I am planning to take Infa Certification exam but am unable to find its dumps anywhere on web. If anybody has it, plz share them with me. jkinfo22@gmail.com Thanks in advance

1639


Can any one give me a real time example for FACT TABLE & DIMENSIONAL TABLE?

1650


list out all the transformations which use cache?

696


wat are deployement groups in informatica, how it will be used for developers

1266