Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

How can we improve session performance in aggregator transformation?

1159


What is a repository manager?

1148


What could be the possible resons of locks by user?

1146


How will the document be delivered to me?

1131


Give one example for each of conditional aggregation, non-aggregate expression, and nested aggregation?

1322


Give some information on report bursting and how to do it in bca as I have to split the report and send different reports to different people?

1154


How to elaborate tracing level?

1223


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

1156


Why filter transformation is an active one?

1033


What is a sequence generator transformation?

1075


Where are the source flat files kept before running the session?

1141


Difference between Target-based loading and constraint-based loading?

1042


Can some one explain me about Telecommunications(wireless) project in Informatica? Thanks in advance

2026


Describe expression transformation?

1170


Dimension Object created in Oracle can be imported in Designer Cubes contain measures

2445