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


Please Help Members By Posting Answers For Below Questions

What is substr in informatica?

1178


Sequence generator, when you move from develoment to production how will you reset

2011


Explain pmcmd command usage in informatica

1105


How to elaborate powercenter integration service?

1112


How to differentiate between the active and passive transformations?

1136


How many ways are there to do 'remove duplicate records in informatica'?

987


What is a repository? And how to add it in an informatica client?

1126


What are the basic requirements to join two sources in a source qualifier transformation using default join?

1102


What is a joiner transformation?

966


What do you mean by channel change?

1021


What is domain and gateway node?

1152


Differentiate between a repository server and a powerhouse?

1099


How to extract the informatica rejected data?

1198


How do you load first and last records into target table? How many ways are there to do it? Explain through mapping flows.

1107


-Which expression we can not use in Maplets?, -Can we join(relate) two dimensions in a schema? -Why and where we use 'sorted input' option?

5757