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
Answers were Sorted based on User's Feedback
Answer / letc
Using max function for q1,q2,q3,q4 in Aggregator transformation. Use sorter before aggregator
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / 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 |
Answer / 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 |
1)you have multiple source system where u receive files ,how do you actually load into mapping using transformation,what are the transformation you use? 2)you have files in ftp location ,how do you get it into mapping with you ETL concept?
performance wise which one is better in joiner and lookup transformation
in staging we are merging the data and remove the inconsistants data that type of situation what u will done and type of functions u can use
wat transf shud i use to achieve this id sal id sal sum src-1 20 tgt 1 20 40 1 20 1 20 40 2 15 2 15 35 2 20 2 20 35
scenario: dept_no emp_nem 10 A, 10 B, 10 C, 10 D, 20 P, 20 Q, 20 R, 20 S output: dept_no emp_nem 10 A, 10 AB, 10 ABC, 10 ABCD, 20 ABCDP, 20 ABCDPQ, 20 ABCDPQR, 20 ABCDPQRS
how do u move the code from development to production?
What is the difference between writing a joiner query in ANSI style and THETA style?
what is a time dimension? give an example?
how i will stop my workflow after 10 errors
guys which is the best institute in banglore to learn informatica??
How to extract the informatica rejected data?
What is a code page?