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

can anybady help me to achieve the aboue result by using informatica.

thanks in advance.

Answer Posted / ankit kansal

One way of doing it is simple using aggregate function.

select year,sum(case when quarter='first' then amount end) as q1_amount
,sum(case when quarter='second' then amount end) as q2_amount
,sum(case when quarter='third' then amount end) as q3_amount
,sum(case when quarter='fourth' then amount end) as q4_amount from test group by year;

http://deepinopensource.blogspot.in/

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If informatica has its scheduler why using third party scheduler?

900


Which transformation is needed while using the Cobol sources as source definitions?

817


Reusable transformation and shortcut differences

1465


What is union transformation in informatica?

802


What is olap (on-line analytical processing?

729






Write the different tools in the workflow manager?

662


What is the difference between writing a joiner query in ANSI style and THETA style?

2017


What are the tasks that source qualifier perform?

722


Global and Local shortcuts. Advantages.

1566


When do you use sql override in a lookup transformation?

670


can i any one explain me realtime healthcare project explanation..for interview .iam new to informatica .thanks in advance.

3448


Can anyone tell me the new features in Informatica 9 Version?

1620


What is dynamic cache?

695


How to improve the performance of a session using sorter transformation?

790


How to open an older version of an object in the workspace?

716