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
Explain an extent?
hello friends Im doing my final year engineering in B.Tech.. one of uncle said he can provide job in his company if im good in database management. but i have only basic knowledge about database, so like to join database management course in good intuition. so friends kindly help me to get good intuition because its my future.
what is the use of system.effective.date variable in oracle?
How to define a cusotmer as a supplier in ORACLE R12
What is tns name?
Query to retrieve record for a many to many relationship ?
List out the types of joins.
What is the difference between alert log file and tarce file ?
What are the different oracle database objects?
What do you mean by cdb and pdb in oracle 12c?
How to sort the query output in oracle?
What happens if variable names collide with table/column names?
when we are importing items in inventory, showing errors, Oracle support suggested us for running scripts & also suggested if we run scripts, iprocurement applicaation if is there it will show shared and if we go in future for iprocurement, it wont work. So kinldy suggest any functional solution.
How to save query output to a local file?
What exactly do quotation marks around the table name do?