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
amount year quarter
1000 2003 first
2000 2003 second
3000 2003 third
4000 2003 fourth
5000 2004 first
6000 2004 second
7000 2004 third
8000 2004 fourth

i want the output
year q1_amount q2_amount q3_amount q4_amount
2003 1000 2000 3000 4000
2004 5000 6000 7000 8000

Answer Posted / chanakya123

SELECT YEAR,
SUM(DECODE(QUARTER,'FIRST',AMOUNT)) Q1_AMOUNT ,
SUM(DECODE(QUARTER,'SECOND',AMOUNT)) Q2_AMOUNT,
SUM(DECODE(QUARTER,'THIRD',AMOUNT)) Q3_AMOUNT,
SUM(DECODE(QUARTER,'FOURTH',AMOUNT)) Q4_AMOUNT
FROM TABLE_NAME GROUP BY YEAR

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Describe an informatica powercenter?

1127


While migrating the data from one environment to another environment how would you manage the connections?

1090


Hi all, Can you please send me the Dimensions and fact tables which are used in mutual fund project. and please send me the brief summary about the project. Please do the needful.

2307


How to join three sources using joiner? Explain though mapping flow.

1148


what is SDLC way of code development?

2044


What is workflow manager?

1053


What is rank transformation?

991


What do think which one is the better joiner or look up?

1204


What do you understand by SOA of Informatica?

992


what is INFORMATICA TESTING process

2297


How to handle decimal places while importing a flatfile into informatica?

1192


What is meant by pre and post session shell command?

1162


Hi all , I am planning for informatica S - PowerCenter 8 Mapping Design certification. I have rewuired the dumps for the same. if anyone of you having the same pl. share it with me. This will be of great help. My contact is : sagardev7@gmail.com TIA , Sagar

2748


Informatica settings are available in which file?

992


What does role playing dimension mean?

1048