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



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

how can u avoid duplicate rows in flat file?

4 Answers   CTS, Wipro,


suppose if we have dublicate records in a table temp n now i want to pass unique values to t1 n dublicat values to t2 in single mapping?how

4 Answers   CTS,


Which transformation should u need while using the cobol sources as source defintions?

2 Answers  


Hi can any one tell me the difference between persistence and dynamic caches? On which conditions we are using these caches?

3 Answers  


Performance wise which is better joiner or look up ? Give me with example?

1 Answers   CGI,


Please let me know how to do estimation before staring development in project. Here estimation in the sense how many associates are required, etc to complete the project.

1 Answers   iGate,


What is sq transformation?

0 Answers  


What is a pre-defined event and user-defined event?

0 Answers  


How to merge First Name & Last Name?

8 Answers  


Design a mapping to get the pervious row salary for the current row. If there is no pervious row exists for the current row, then the pervious row salary should be displayed as null.

0 Answers   Informatica,


WHAT IS THE DIFFERENCE BETWEEN .NET AND INFORMATICA?

1 Answers  


Why do flat file load is faster if you compare that with table load ? Please answer me. Advance Thanks, Manojkumar

11 Answers   IBM,


Categories