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 tokens will generate?
What is a surrogate key?
explain about unit testing? in real time?
I have 100 records in source table, but I want to load 1, 5,10,15,20…..100 into target table. How can I do this? Explain in detailed mapping flow.
expain about the tune parameters?
State the limitations where we cannot use joiner in the mapping pipeline?
What are the various test procedures used to check whether the data is loaded in the backend, performance of the mapping, and quality of the data loaded in informatica?
I am new to informatica and learning it,can anybody please tell me how we receive source as flat file in informatica,from where we get this flat file?
What is a snowflake schema?
Why do you use Mapping Parameter and mapping variable?
Explain the different kinds of facts.
What are the tuning techniques you applied during your last project
Reusable transformation and shortcut differences
What are the different lookup cache(s)?
Can we create multiple integration service on single repository?