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



write sql query following table amount year quarter 1000 2003 first 2000 2003 ..

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

More Informatica Interview Questions

what is meant by lookup caches?

2 Answers   Cap Gemini, Informatica,


what are the differences between powercenter 8.1 and powercenter 8.5?

2 Answers  


Separate from an archive server and a powerhouse?

1 Answers  


Plz can any one say me how to get the informatica certification materials and dumps

1 Answers   TCS,


What is joiner cache?

2 Answers   TCS,


Under which circumstances, informatica server creates reject files?

1 Answers   Informatica,


what is dynamic cashe

3 Answers   Informatica,


in staging we are merging the data and remove the inconsistants data that type of situation what u will done and type of functions u can use

1 Answers   TCS,


Hi all, i am new to this site and new to Informatica too. I have few questions regarding that. 1) When we load flat files into target tables how do we identify duplicates? and where do load the duplicate records for further reference? 2) How do we do chage data capture? Is this Slowly changing Dimension technique? Thanks in Advance

3 Answers  


i have to extract data from a flat file.the flat file has 10 records.i have to extract the 1st and 5th record every time.how is it done.

10 Answers   Emirates, IBM,


can any one explain about dataflow in the informatica project for bank domain....thanks is advance

1 Answers   IBM,


hw cn v elimate dublicate values from lookup without overriding sql?

7 Answers   CTS,


Categories