write sql query following table
quarter sales
q1 1000
q1 2000
q1 3000
q1 4000
q2 5000
q2 6000
q2 7000
q2 8000
q3 1000
q3 2000
q3 3000
q3 4000
q4 5000
q4 6000
q4 7000
q4 8000
i want the output format like
q1 q2 q3 q4
1000 5000 1000 5000
2000 6000 2000 6000
3000 7000 3000 7000
4000 8000 4000 8000
Answer Posted / ankit kansal
one solution can be like this
select max(q1) as q1,max(q2) as q2,max(q3) as q3,max(q4) as q4 from
(
select case when quarter = 'q1' then sales end q1
,case when quarter = 'q2' then sales end q2
,case when quarter = 'q3' then sales end q3
,case when quarter = 'q4' then sales end q4
,row_number() over ( partition by quarter order by 1 ) rnk
from sequel_test order by 5
)tb group by rnk order by 1,2,3,4
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
SOURCE DATA IS DISPLAY IN THIS FORMATE IN TARGET . WHAT BUSINESS LOGIC WE CAN APPLY. source table target table ------------ ------------ c1 c2 c3 c1 c2 c3 -- -- -- -- -- -- 1 A J 1 2 B K 2 A 3 C L 3 B J 4 D M 4 C K 5 E N 5 E L F M N
What all join we can perform in LOOKUP transformation?
What are the different components of powercenter?
WHAT IS EDM?WHAT IS THE USE IN INFORMATICA? chandumba2005@gmai.com
Clarify the aggregator change?
What are the new features of informatica 9.x at the developer level?
One of the optimizing technique to improve the session performance is push down optimization,by using push down optimization we push as much as transformation logic to source/target database,but this degrades the d/b performance,how to overcome this?
what is informatica metadata?
-Which expression we can not use in Maplets?, -Can we join(relate) two dimensions in a schema? -Why and where we use 'sorted input' option?
What are junk dimensions?
What is dimensional table?
How do you take back up of repository?
How might one distinguish in the case of mapping is right or not without associating session?
Differences between version 7.x and 8.x.
What are multi-group transformations?