write a query row to column follwing source?

quarter sales
q1 5000
q1 9000
q1 7000
q1 6000
q2 5000
q2 4000
q2 3000
q2 1000
q3 4000
q3 3000
q3 1000
q3 2000
q4 5000
q4 400
i want the output?
q1 q2 q3 q4
sales

Answer Posted / ankit kansal

Hi All,
select sales,sum(q1),sum(q2),sum(q3),sum(q4)
from
select 'sales' as sales
,case when quarter='q1' then sales else 0 end case as q1
...q2
...q3
...q4
)temp group by sales;

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

How do you handle two sessions in Informatica

664


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

686


What is the use of source qualifier?

670


What is informatica worklet?

610


Explain sql transformation in script mode examples in informatica

603






What is the use of target designer?

606


What do you mean by DTM and Load manager and what is difference between load manager and load balancer?

636


Explain what transformation and how many are there in informatica?

482


what are 3 tech challenges/ common issues you face?

1887


What is the status code in stored procedure transformation?

683


What are session parameters ? How do you set them?

1375


hi real timers . iam waiting for ur reply regarding ETL TESTING

1804


Explain about cumulative Sum or moving sum?

618


What are the designer tools for creating transformations?

680


what is informatica metadata?

597