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
amount year quarter
1000 2003 first
2000 2003 second
3000 2003 third
4000 2003 fourth
5000 2004 first
6000 2004 second
7000 2004 third
8000 2004 fourth

i want the output
year q1_amount q2_amount q3_amount q4_amount
2003 1000 2000 3000 4000
2004 5000 6000 7000 8000

can anybady help me to achieve the aboue result by using informatica.

thanks in advance.

Answer Posted / qlikstar

Select year,
sum(case when quarter = 'first' then amount end) AS q1_amount,
sum(case when quarter = 'second' then amount end) AS q2_amount,
sum(case when quarter = 'third' then amount end) AS q3_amount,
sum(case when quarter = 'fourth' then amount end) AS q4_amount

from table
group by year order by year

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Suppose we have two source qualifier transformations sq1 and sq2 connected to target tables tgt1 and tgt2 respectively. How do you ensure tgt2 is loaded after tgt1?

1196


What do you mean by DTM and Load manager and what is difference between load manager and load balancer?

1071


Enlist the various types of transformations.

949


Design a mapping to get the pervious row salary for the current row. If there is no pervious row exists for the current row, then the pervious row salary should be displayed as null.

1224


What is confirmed fact in dataware housing?

6793


3.how will u get information about bugs how will u rectify the bugs in realtime whch tool we are using to rectify the bugs

2180


How to create or import flat file definition in to the warehouse designer?

1018


differences between service based and product based?

1966


what is the size of u r source(like file or table)?

2197


Hi, I am planning to take Infa Certification exam but am unable to find its dumps anywhere on web. If anybody has it, plz share them with me. jkinfo22@gmail.com Thanks in advance

1994


What is DR strategy for Informatica project?

1112


Tell me can we override a native sql query within informatica? Where do we do it? How do we do it?

1009


What is the difference between STOP and ABORT options in Workflow Monitor?

1173


Explain is there any way to read the ms excel datas directly into informatica? Like is there any possibilities to take excel file as target?

1046


Differentiate between a database and data warehouse?

1087