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 different types of repositories created using informatica?
Enterprise data warehouse your projects phase by phase explain?
If the source has duplicate records as id and name columns, values: 1 a, 1 b, 1 c, 2 a, 2 b, the target should be loaded as 1 a+b+c or 1 a||b||c, what transformations should be used for this?
What are the challenges you have faced in your Project (DWH- ETL)? Explain with example?
Separate from a database, an information bazaar, and an information stockroom?
What are the tasks that can be performed using sq?
Dimension Object created in Oracle can be imported in Designer Cubes contain measures
Explain what is informatica metadata and where is it stored?
How do you remove duplicate records in informatica? And how many ways are there to do it?
How might you approve all mappings in the archive all the while?
Design a mapping to get the pervious row salary for the current row. If there is no pervious row exists for the current row, then the pervious row salary should be displayed as null.
Whats there in global repository
How can we update a record in the target table without using update strategy?
What is a connected transformation?
How to configure mapping in informatica?