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 / jj
without one more column its not possible i thing , it shoud
have prod or some thing
select prod,sum(q1),sum(q2),sum(q3),sum(q4) from (
select prod,(case when quarter='q1' then sal end) q1
,(case when quarter='q2' then sal end) q2
,(case when quarter='q3' then sal end) q3
,(case when quarter='q4' then sal end) q4 from za)
group by prod
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Is it possible to revert a global repository to local one and why?
What are the differences between source qualifier and joiner transformation?
How many types of sessions are there in informatica.please explain them?
how lookup transformation is made active in new versions... When to use connected and when to use unconnected lookup and why? which is good for session performance. How to make lookup persistent and how to remove stale data from that lookup. how commit works - when we stop or abort data. Explain in both cases. What is factless fact table and have you ever used it in real time scenarios.
What is the difference between Active and Passive transformation?
Explain sessions?
What are the features of complex mapping?
How do you handle two sessions in Informatica
where to store informatica rejected data?
What are the tasks that source qualifier perform?
Describe the scenarios where we go for joiner transformation instead of source qualifier transformation?
What is a joiner transformation?
suppose we are using dynamic lookup cache and in lookup condition the record is succeeded but in target it is failed due to some reasons then what happened in the cache ?
What are the components of Informatica? And what is the purpose of each?
How can we store previous session logs?