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 / farrukh shaikh

select empid,
salary,
sum(salary) over(order by empid rows unbounded
preceding) composite_sal from (select 101 EmpID, 1000
Salary
from dual
union all
select 102, 2000
from dual
union all
select 103, 3000
from dual
union all
select 110, 5000 from dual)

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between cartesian join and cross join?

1092


Why does for update in oracle 8 cause an ora-01002 error?

1003


Explain integrity constraint?

1164


What is ordinary table in oracle?

1159


How to load data from external tables to regular tables?

1062


How many types of synonyms in Oracle?

1125


What is the difference between primary key and unique key and foreign key in oracle?

982


What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar

4599


What are ddl statements in oracle?

1076


How do we get field detail of a table?

1081


how to join query for one source type is oracle another source type is sql server ?

2428


Explain the use of consistent option in exp command.

1070


What privilege is needed for a user to query tables in another schema?

973


What privilege is needed for a user to create views in oracle?

1053


How to create id with auto_increment on oracle?

990