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 |
if we r using aggregator we enabled sorted input but the records r not sorted what happen?
how to return multiple columes through through un-connect lookup?
what is difference between mapping and mapplet ?
I have a flat file, in which i have two fields, emp_id, emp_name. The data is like this, emp_id,emp_name 101,soha 101,ali 101,khan 102,siva 102,shanker 102,reddy. how to merge the names so that my output is like this Emp_id Emp_name 101 Soha ali kahn 102 siva shenkar reddy please provide solution
what is left outer join?
How will restrict values in 0-9 and A-Z and a-z and special character.Only allowed these chars otherwise we will reject the records? what is the function we used to restrict...
what are the challenge face in u r project?explain me
what is the drillup & drill down?and use of the drill up and drill down?
what is the use of Data Mart?
What is a code page?
How to extract original records at one target & Duplicate records at one target? {with out using EXPRESION transformation and sequence generator transformation?}<-this is important
How can we improve session performance in aggregator transformation?