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
What is difference between cartesian join and cross join?
Why does for update in oracle 8 cause an ora-01002 error?
Explain integrity constraint?
What is ordinary table in oracle?
How to load data from external tables to regular tables?
How many types of synonyms in Oracle?
What is the difference between primary key and unique key and foreign key in oracle?
What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar
What are ddl statements in oracle?
How do we get field detail of a table?
how to join query for one source type is oracle another source type is sql server ?
Explain the use of consistent option in exp command.
What privilege is needed for a user to query tables in another schema?
What privilege is needed for a user to create views in oracle?
How to create id with auto_increment on oracle?