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

write sql query following source are
EmpID, Salary
101 1000
102 2000
103 3000
I want the output format like following
empid,sal,composite_sal
101 1000 1000
102 2000 3000
103 3000 6000

Answer Posted / bijaylaxmi sahoo

write sql query following source are
table name-emp_det
EmpID, Salary
101 1000
102 2000
103 3000
answer-
select t.empid,t.sal,(select sum(x.sal) from emp_det x
where x.empid<=t.empid) as com_sal
from emp_det t;
output-
empid,sal,composite_sal
101 1000 1000
102 2000 3000
103 3000 6000

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a trigger and what are its types?

1148


How to view existing locks on the database?

1011


What are the uses of linked server and explain it in detail?

1026


is there a tool to trace queries, like profiler for sql server?

1100


How to set up autotrace for a user account?

993


How to change user password in oracle?

983


What is user managed backup in Oracle?

1096


interview questions with answer for cts

2547


How to pass a parameter to a cursor in oracle?

1124


what is IDE,DMV in sql server?

2775


Explain the use of tables option in exp command.

1074


Can we write insert statement in function in oracle?

1048


How to handle a single quote in oracle sql?

990


Explain the use of online redo log files in oracle.

1009


How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?

2222