Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

if we r using aggregator we enabled sorted input but the records r not sorted what happen?

7 Answers   HSBC,


how to return multiple columes through through un-connect lookup?

1 Answers   DELL,


what is difference between mapping and mapplet ?

2 Answers   TCS,


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

5 Answers  


what is left outer join?

3 Answers   L&T,


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

3 Answers   Cap Gemini,


what are the challenge face in u r project?explain me

1 Answers   iGate, TCS,


what is the drillup & drill down?and use of the drill up and drill down?

1 Answers   IBM,


what is the use of Data Mart?

5 Answers   IBM,


What is a code page?

0 Answers  


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

4 Answers   CTS,


How can we improve session performance in aggregator transformation?

0 Answers   Informatica,


Categories