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

What is data movement mode in Informatica and difference between them?

616


What is a node in Informatica?

618


What are session parameters ? How do you set them?

1374


What is informatica?

675


what is the hint? how to use it to reduce the query processing in program?

6282






Explain what are the different types of transformation available in informatica. And what are the mostly used ones among them?

603


Can I use same Persistent cache(X.Dat) for 2 sessions running parallely? If it is not possible why?If yes How?

1616


What is the need of etl tools?

603


Have you worked with/created Parameter file

1224


What is event and what are the tasks related to it?

612


Explain what are the different types of transformation available in informatica.

567


Explain joiner transformation in informatica

664


What is joiner transformation in informatica?

623


How to do the error handling of if ur source is flatfiles?

1506


which one is better performance wise joiner or look up

620