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 source table

jan feb mar apr
100 200 300 400
500 600 700 800
900 100 200 300
i want the output format like

month total
jan 1500
feb 900
mar 1200
apr 1500

Answer Posted / chanakya123

Hi, Using UNION ALL ,You can achieve it, here is Your Query

SELECT 'JAN' AS MONTH, SUM(JAN) AS TOTAL FROM SRC_MONTHS
UNION ALL
SELECT 'FEB' AS MONTH, SUM(FEB) AS TOTAL FROM SRC_MONTHS
UNION ALL
SELECT 'MAR' AS MONTH, SUM(MAR) AS TOTAL FROM SRC_MONTHS
UNION ALL
SELECT 'APR' AS MONTH, SUM(APR) AS TOTAL FROM SRC_MONTHS

Thanks
Kalyan Sankuthula

Is This Answer Correct ?    23 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Design time, run time. If you don't create parameter what will happen

1892


I have three same source structure tables. But, I want to load into single target table. How do I do this? Explain in detail through mapping flow.

1337


Please let me know how to make Data masking in informatica..

1773


Explain pmcmd command usage in informatica

1188


What are the differences between source qualifier and joiner transformation?

1137


How to elaborate powercenter integration service?

1174


What is the commit type if you have a transaction control transformation in the mapping?

1099


have u done any performance tuning? how u ll do?

2365


What is rank transform?

1061


What happens when a session fails and you click on recover?

1172


Clarify the aggregator change?

1080


How can informatica be used for an organization?

1274


What is a mapplet/worklet in informatica?

1244


Define mapplet?

1059


What is a repository manager?

1148