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
How can we update a record in the target table without using update strategy?
Briefly explain your complete project(sales) flow, (ie. from source received from client, transformations, then despatch to end user) what are all the process. Kindly give step by step process.
How we can create indexes after completing the load process?
How to join three sources using joiner? Explain though mapping flow.
In how many ways we can create ports?
How to do unit testing in informatica?
How do you load only null records into target? Explain through mapping flow.
What is the maplet?
in reporting we add some new objects,how we get the count of the newly added objects to the report
Explain lookup transformation source types in informatica
IN SCD1, insource we have 10 billion records and in the first day its uploaded successfully and in the second day its taking time to upload because some records it might get update or insert new records. As a developer what will be the better solution for this??
Sequence generator, when you move from develoment to production how will you reset
How do you update the records with or without using update strategy?
What is the use of target designer?
what is SDLC way of code development?