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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define mapping and session?

968


What are the different lookup cache(s)?

1033


Is it possible to revert a global repository to local one and why?

1023


What do you mean incremental aggregation?

1010


What is informatica worklet?

987


What are active and passive transformations?

1020


what is song in infrmatica...?

2162


Briefly describe lookup transformation?

982


Enlist the tasks for which source qualifier transformation is used.

981


If the source has duplicate records as id and name columns, values: 1 a, 1 b, 1 c, 2 a, 2 b, the target should be loaded as 1 a+b+c or 1 a||b||c, what transformations should be used for this?

9972


Can we create two repositories on same database instance in oracle?

1015


what are factless facts? And in which scenario will you use such kinds of fact tables.

1740


What is data transformation manager process?

1078


Explain joiner transformation in informatica

1074


what is the hint? how to use it to reduce the query processing in program?

7629