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

can any one give some examples for pre sql and post sql(Except dropping and creating index).

4095


Mention few power centre client applications with their basic purpose?

931


Explain how many types of dimensions are available in informatica?

1073


What is a code page?

1159


Informatica settings are available in which file?

976


What is blocking transformation?

1126


What is the reusable transformation?

1035


How identifying bottlenecks in various components of informatica and resolving them?

1104


What is the advantage of informatica?

1055


Explain the different lookup methods used in informatica?

1023


How do you load unique records into one target table and duplicate records into a different target table?

1205


where to store informatica rejected data? How to extract the informatica rejected data?

985


is it possible to index the data in cache of lkp transformation ?

2018


Explain pushdown optimization and types in informatica

1054


How to go to the older version for a mapping?

1068