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
What does “tail –f” command do and what is its use as an Informatica admin.
What is an aggregator transformation?
How to Create a folder using pmrep command?
differences between service based and product based?
In how many ways we can create ports?
How many numbers of sessions can one group in batches?
What are the guidelines to be followed while using union transformation?
What are the advantages of informatica?
Informatica Checkpoints
Which is the t/r that builts only single cache memory?
What is union transformation?
What are the different options available for update strategy?
To import the flat file definition into the designer where should the flat file be placed?
Explain the mapping variable usage example in informatica
How big was your fact table