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

Explain about achiever in sql?

979


What is the quickest way to fetch the data from a table?

1000


Explain about integrity constraint?

1077


Which dictionary tables and/or views would you look at to diagnose a locking issue?

1849


what is insert all statement in sql

6393


How to define an oracle cursor variable?

973


What is a database table in oracle?

951


How to select all columns of all rows from a table in oracle?

990


why dont we assign not null constraint as table level constraint.

2683


How do I uninstall oracle 11g?

1041


Why do we need integrity constraints in a database?

971


what are actual and formal parameters?

1048


What is oracle database 10g express edition?

1070


What is the disadvantage of User defind function?

2238


How is it different from a normal table?

966