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
Explian the Process of deployment groups in informatica
What are the different transaction levels available in transaction control transformation?
How to generate sequence numbers?
Did u used latest transformations of 8.6.0? for what?
What is informatica? Why do we need it?
What is union transformation in informatica?
How to start a workflow using pmcmd command?
Can we use the mapping parameters or variables created in one mapping into any other reusable transformation?
Can u generate reports in Informatica?
My source is delimited flat file Flat file data is H|Date D1|ravi|bangalore D2|raju|pune T|4 The data will be send to target if the fallowing two conditions satisfied 1.The first row Date column is equal to SYSDATE 2.Last record second port equal to number of records. How to achieve?
What are the guidelines to be followed while using union transformation?
What do you mean by enterprise data warehousing?
What is the use of source qualifier?
What is informatica?
Explain Dataware house architecture .how data flow from intial to end?