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
Describe an informatica powercenter?
While migrating the data from one environment to another environment how would you manage the connections?
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.
How to join three sources using joiner? Explain though mapping flow.
what is SDLC way of code development?
What is workflow manager?
What is rank transformation?
What do think which one is the better joiner or look up?
What do you understand by SOA of Informatica?
what is INFORMATICA TESTING process
How to handle decimal places while importing a flatfile into informatica?
What is meant by pre and post session shell command?
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
Informatica settings are available in which file?
What does role playing dimension mean?