Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



write sql query following table quarter sales q1 1000 q1 2000 q1 3000 q1 ..

Answer / parthu

It may possible with Normalizer transformation.

Is This Answer Correct ?    1 Yes 0 No

write sql query following table quarter sales q1 1000 q1 2000 q1 3000 q1 ..

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

write sql query following table quarter sales q1 1000 q1 2000 q1 3000 q1 ..

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

write sql query following table quarter sales q1 1000 q1 2000 q1 3000 q1 ..

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

write sql query following table quarter sales q1 1000 q1 2000 q1 3000 q1 ..

Answer / chandu

In Expression transfermation, if( sales = q1,sales,0)

Is This Answer Correct ?    1 Yes 13 No

Post New Answer

More Informatica Interview Questions

What is informatica etl tool?

0 Answers  


What is exclusive and normal mode for repository services?

0 Answers  


Explain the mapping variable usage example in informatica

0 Answers   Informatica,


I have done MBA in 2008. i got job as business analyst in 2008 january through consultany. but after 3 months they are giving training Informatica developer. now iam continuing this job. my question is when iam going to interview HR people ask me many times like this " YOU ARE MBA GRADUATE. HOW YOU ARE SELECT THIS POSTION. IAM EXPLAINING WHAT I HAVE MENTION ABOVE". PLEASE TELL HOW IAM TELLING THIS QUESTION ANSWER.

0 Answers  


Can you copy the batches?

3 Answers  


I have 4 columns in a table say, name ,address, salary and city. So based on distinct city names, i need to combine the other data and send it to a flat file. Distinct city names can be 4 or 5 or 6. So it has to dynamically generate flat files(4 or 5 or 6) corresponding to the city names.

2 Answers  


Without using Lookup & Sequence Generator, How to generate Sequence?

5 Answers   CTS,


Major difference between SQL override and Lookup Sql override

1 Answers  


how to join the two flatfiles using the joiner t/r if there is no matching port?

5 Answers   Cegedim,


Difference between Target-based loading and constraint-based loading?

0 Answers  


How do schedule a workflow in Informatica thrice in a day? Like run the workflow at 3am, 5am and 4pm?

3 Answers   Logica CMG,


Session S1, S2, and S3. In the session S3 I want to load every Saturday. How it is possible?

2 Answers   TCS,


Categories