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
How to do unit testing in informatica? How to load data in informatica ?
Explain direct and indirect flat file loading (source file type) - informatica
How do you remove duplicate records in informatica? And how many ways are there to do it?
How to extract the informatica rejected data?
IN SCD1, insource we have 10 billion records and in the first day its uploaded successfully and in the second day its taking time to upload because some records it might get update or insert new records. As a developer what will be the better solution for this??
Quickly characterize reusable change?
Explain the aggregator transformation?
how to construct simple biogas digerter? please show me detail drawing and specification of simple biogas construction?
Suppose on 1st Nov 2010 you had created a mapping which includes huge aggregator calculations and it is under process for next two days. You will notice that even on 3rd day also its still calculating. So without changing a logic or changing a mapping How will you troubleshot or to run that mapping? Explain the steps
What are the conditions needed to improve the performance of informatica aggregator transformation?
How can we create index after completion of load process?
tell me 5 session failure in real time how can you solve that in your project?
explain one complex mapping with logic? sales project?
Which transformation is needed while using the Cobol sources as source definitions?
If the source has duplicate records as id and name columns, values: 1 a, 1 b, 1 c, 2 a, 2 b, the target should be loaded as 1 a+b+c or 1 a||b||c, what transformations should be used for this?