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 |
How do you recover rows from a failed session
What is the filename which you need to configure in UNIX while installing infromatica?
How to recover sessions in concurrent batches?
If you want to create indexes after the load process which transformation you choose?
Which transformation is needed while using the Cobol sources as source definitions?
Slowly changing dimensions, types and where will you use them
How we can create indexes after completing the loan process?
Performance tuning( what you did in performance tuning)
What is status code?
What is Java Transformation? what are the uses of it?
How do you use reject loader.
How to generate sequence numbers using expression transformation?