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



Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal ..

Answer / niru

select name,salary from emp
union
select "total",sum(sal) from emp

Is This Answer Correct ?    11 Yes 4 No

Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal ..

Answer / kiran

SQL> select ename,sal from emp union select 'total:',sum(sal) from emp;

Is This Answer Correct ?    7 Yes 0 No

Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal ..

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

Scenario is like this: Name Sal A 10; B 20; C 30; Then Output should be Name Sal ..

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

Post New Answer

More Informatica Interview Questions

How to create the source and target database connections in server manager?

0 Answers   Informatica,


What do you mean by channel change?

0 Answers  


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.,,

1 Answers  


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???

5 Answers   Wipro,


explain abt joiner t/r?

1 Answers   IBM,






write a sql query following source? subject mark maths 30 science 20 social 80 requird output maths science social 30 20 80

3 Answers   iGate,


What is a poling?

2 Answers  


how to run the batch using pmcmd command

2 Answers   Wipro,


How mapping parameter and variable works

1 Answers  


How to generate the HTML output using Informatica.

3 Answers   Wipro,


Tell me one complex query in oracle ?

2 Answers   L&T, Satyam,


How can we use batches?

0 Answers  


Categories