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
Explain about achiever in sql?
What is the quickest way to fetch the data from a table?
Explain about integrity constraint?
Which dictionary tables and/or views would you look at to diagnose a locking issue?
what is insert all statement in sql
How to define an oracle cursor variable?
What is a database table in oracle?
How to select all columns of all rows from a table in oracle?
why dont we assign not null constraint as table level constraint.
How do I uninstall oracle 11g?
Why do we need integrity constraints in a database?
what are actual and formal parameters?
What is oracle database 10g express edition?
What is the disadvantage of User defind function?
How is it different from a normal table?