Scenario is like this:
Name Sal
A 10;
B 20;
C 30;
Then Output should be
Name Sal
A 10;
B 20;
C 30;
Total 60;
Use SQL For this scenario
Answers were Sorted based on User's Feedback
Answer / niru
select name,salary from emp
union
select "total",sum(sal) from emp
Is This Answer Correct ? | 11 Yes | 4 No |
Answer / kiran
SQL> select ename,sal from emp union select 'total:',sum(sal) from emp;
Is This Answer Correct ? | 7 Yes | 0 No |
Answer / situ
first create a table emp4 using the above data then execute the below query to find that output
select case when grouping(name)=1 then 'Total'else name end as name,sum(sal) as sal from emp4 group by rollup(name);
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / pooja
Select case when GROUPING(e.Name)= 1
then'Total'else e.Name end as Name,
sum(e.Salary)as Salary from Emp e
group by e.Name with rollup
Is This Answer Correct ? | 0 Yes | 0 No |
What is the meaning of decode in informatica?
One source and 3 targets 1st row-1st target 2nd row-2nd target 3rd row-3rd target 4th row-1ist target how will u do?
How to recover sessions in concurrent batches?
complex mapping ur project u r invlve can u explain and give real time example give me ?
how will you get 21 to 30 record from 50 records?
What are the options in the target session of update strategy transsformatioin?
Is there any way to read the ms excel datas directly into informatica?
how remove 1st 3 records & last 3 records in informatics
followin source like region sales 1 100 2 200 i want the output following format region 1 2 sales 100 200
I have table with ID,PRD_DT,PRD_FLAG,CUST_DT,CUST_FLAG I need to get max date and its corresponding flag for both the date columns. Ex:- 1A,10/3/2015,AC,10/3/2015,XY 1A,10/4/2015,AB,10/2/2015,XZ Output needed 1A,10/4/2015,10/3/2015,XY I have 100 million + in the table so avoid self-join...
By using Transformation i need top most 5 employee salary from each deptwise? Deptno 10,20,30? which transformation we need to use?
What is IQD file?