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 are the static cache and dynamic cache in informatica?
How might one distinguish in the case of mapping is right or not without associating session?
Explain the informatica workflow?
What is standalone command task?
How can you validate all mappings in the repository simultaneously?
explain any diffcult scenario that u have faced in your experience... or explain any complex maping u have developed?
How can we delete duplicate rows from flat files?
What are the settings that you use to configure the joiner transformation?
hi real timers . iam waiting for ur reply regarding ETL TESTING
During the running session, output files are created by informatica server. Enlist few of them.
Define the various join types of joiner transformation?
In how many ways we can create ports?
What are the differences between oltp and olap?
SOURCE DATA IS DISPLAY IN THIS FORMATE IN TARGET . WHAT BUSINESS LOGIC WE CAN APPLY. source table target table ------------ ------------ c1 c2 c3 c1 c2 c3 -- -- -- -- -- -- 1 A J 1 2 B K 2 A 3 C L 3 B J 4 D M 4 C K 5 E N 5 E L F M N
Explain pushdown optimization and types in informatica