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 to create the source and target database connections in server manager?
What do you mean by channel change?
case and like function in informtica (my source is XML). case when OS Like'%Windows%' and OS Like '%200%' then 'Windows 200' case when OS Like'%Windows%' and OS Like '%200%'and OS like '%64%' then 'windows 200 64 bit' etc.,,
If i havee 3records in my source having same deptno like Deptid Deptno ------ ------ 101 10 201 10 301 10 and i am using router TR to loading these records into target.Then how many record'll be loaded into target???
explain abt joiner t/r?
write a sql query following source? subject mark maths 30 science 20 social 80 requird output maths science social 30 20 80
What is a poling?
how to run the batch using pmcmd command
How mapping parameter and variable works
How to generate the HTML output using Informatica.
Tell me one complex query in oracle ?
How can we use batches?