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 difference between Bulk Load and Normal Load

3 Answers   TCS,


Explain load alternative records / rows into multiple targets - informatica

0 Answers   Informatica,


What is the status code in stored procedure transformation?

0 Answers   Informatica,


what is sql override?what is the use of it?

4 Answers   Sonata,


What are the modules in Power Center

0 Answers  






Consider two cases: (1) Power Center Server and Client on the same machine (2) Power Center Sever and Client on the different machines what is the basic difference in these two setups and which is recommended?

2 Answers  


What are the new features of informatica 9.x at the developer level?

0 Answers  


Could any one to tell How to use the Oracle Analytic functions in Informatica?

1 Answers  


difference between informatica 8.1.1 and 8.6

0 Answers   TCS,


Hi, source data is col1 values are 5,6,7 col2 are 3,2,1 col3 are 8,9,10 and i want to get target as col1 5,6,7 col2 1,2,3 col3 8,9,10 how to do this one?

6 Answers  


Hi ETL gurus can any one tell me with a flow how to implement SCD Type 1 and SCD Type 2 in a single mapping.For some fields SCD type has to be implemented and for some fields scd type has to be implementd..Thank in advance..please let me know in case of any concerns...

1 Answers  


what is mean by grouping of condition column in lookup transformation?

1 Answers  


Categories