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 / ankit kansal

One way of doing it is simple using aggregate function.

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 test group by year;

http://deepinopensource.blogspot.in/

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is enterprise data warehousing?

1048


Explain pushdown optimization $pushdownconfig parameter - informatica

1140


Explain how to import oracle sequence into informatica?

1011


Explain the difference between mapping parameter and mapping variable?

1038


Do you find any difficulty while working with flat files as source and target?

1098


What does command task mean?

1148


What is flashback table ? Advance thanks

1936


How to generate or load values in to the target table based on a column value using informatica etl tool.

1074


How can we use batches?

1025


Describe the impact of several join conditions and join order in a joiner transformation?

1063


Enterprise data warehouse your projects phase by phase explain?

1921


Explain the tuning lookup transformation - informatica

994


if we have a delimiters at unwanted places in a flat file how can we over come those.

2049


What are the different types of repositories created using informatica?

1139


What are the new features of informatica 9.x in developer level?

998