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 dead lock in oracle?

1101


What is bulk copy or bcp in oracle?

1103


Name the various constraints used in oracle?

1005


How to use like conditions in oracle?

1026


How to create an oracle database manually?

1059


What is an oracle wallet?

928


What is the use of aggregate functions in oracle?

1015


How to retrieve the count of updated rows?

1111


How to count duplicated values in a column in oracle?

1027


What are the general rules on data consistency?

992


what is Single Byte Overhead...?

2540


What is transaction control statement and how many types of transaction control statement in Oracle?

1135


Can I create users through internet explorer in oracle 10g?

1069


Explain compound trigger in oracle?

1019


How to use select statement to count the number of rows in oracle?

1028