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

Explain dynamic target flat file name generation in informatica

1055


Enlist the differences between database and data warehouse.

1121


What is the difference between informatics 7x and 8x and what is latest version?

1085


what is index?how it can work in informatica

2041


Tell me any other tools for scheduling purpose other than workflow manager pmcmd?

1323


explain abt ur project architecture?

2196


Under what condition selecting sorted input in aggregator may fail the session?

1127


Write the program through which the records can be updated?

1006


Can we use the mapping parameter or variables developed in one mapping into any other reusable transformation?

1134


Explain about Informatica server process that how it works relates to mapping variables?

1081


What will be the approach?

980


How to load last n records of file into target table - informatica

1082


What is the use of source qualifier?

1138


Explain the different kinds of facts.

982


Define sessions in informatica etl?

1035