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

What is the meaning of decode in informatica?

0 Answers  


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?

5 Answers   HCL,


How to recover sessions in concurrent batches?

1 Answers  


complex mapping ur project u r invlve can u explain and give real time example give me ?

0 Answers   HGS, TCS,


how will you get 21 to 30 record from 50 records?

6 Answers  






What are the options in the target session of update strategy transsformatioin?

2 Answers  


Is there any way to read the ms excel datas directly into informatica?

0 Answers  


how remove 1st 3 records & last 3 records in informatics

4 Answers   TetraSoft,


followin source like region sales 1 100 2 200 i want the output following format region 1 2 sales 100 200

2 Answers   Oracle,


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

2 Answers   Amex,


By using Transformation i need top most 5 employee salary from each deptwise? Deptno 10,20,30? which transformation we need to use?

8 Answers  


What is IQD file?

1 Answers  


Categories