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
What is a dead lock in oracle?
What is bulk copy or bcp in oracle?
Name the various constraints used in oracle?
How to use like conditions in oracle?
How to create an oracle database manually?
What is an oracle wallet?
What is the use of aggregate functions in oracle?
How to retrieve the count of updated rows?
How to count duplicated values in a column in oracle?
What are the general rules on data consistency?
what is Single Byte Overhead...?
What is transaction control statement and how many types of transaction control statement in Oracle?
Can I create users through internet explorer in oracle 10g?
Explain compound trigger in oracle?
How to use select statement to count the number of rows in oracle?