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

How to configure mapping in informatica?

682


What is an Integration service in Informatica?

708


Explain pushdown optimization $pushdownconfig parameter - informatica

705


Which means the first record should come as last record and last record should come as first record and load into the target file?

615


Is it possible to use a client with different version than that of its Informatica server?

650






Explain the types of transformations?

603


can anyone suggest best free Talend data integration training online

1266


What is informatica metadata and where is it stored?

593


Explain constraint based loading in informatica

663


what are the different types of transformation available in informatica. And what are the mostly used ones among them?

548


Can we create multiple integration service on single repository?

705


can i any one explain me realtime healthcare project explanation..for interview .iam new to informatica .thanks in advance.

3330


 Informatica Checkpoints

2863


What is sorter transformation?

587


waht type of interface is used for testing the data in informatica

1839