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 are the types of schemas we have in data warehouse and what are the difference between them?

0 Answers  


Explain joiner transformation in informatica

0 Answers   Informatica,


List the transformation used for the following: (1) Heterogeneous Sources (2) Homogeneous Sources (3) Find the 5 highest paid employees within a dept. (4) Create a Summary table (5) Generate surrogate keys

1 Answers  


Explain reference cursor?

1 Answers  


Why update strategy and union transformations are active? Explain with examples.

0 Answers  






What are different types of transformations available in informatica?

0 Answers  


what are the difference between Informatica 7.1 and 8.1?

6 Answers  


What are the settings that you use to configure the joiner transformation?

0 Answers   Informatica,


Q. WE ARE LOADING ORACLE TABLE THE PROCESS RUNS THREE HOURS. THIS TABLE IS BEING USED BY SOME DOWNSTREAM TEAMS SO WHAT WE WANT IS IN BETWEEN RUN IS PROGRESS IF ANYONE IS FETCHING THE DATA FROM THE TABLE THEY SHOULD SEE DATA TILL YESTERDAY TILL THAT. AFTER THAT PROCESS IS COMPLETED ONLY THEN TEAM SHULD BE AVAIBLE TO SEE TODAY DATA UPDATED. WE DONOT WANT TO LOG THE TABLE. NEED APROACH FROM YOUR SIDE.

0 Answers  


i hav a scenario like this i want load data from source to target as follows frist it counts the num of deptno and display with that with count and how many times it reapts along with all the records in source

1 Answers  


To provide support for Mainframes source data,which files r used as a COBOL files

1 Answers  


what is curr val use for in sequence generator?

2 Answers   Emphasis,


Categories