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
How to create a new tablespace in oracle?
Who developed oracle & when?
What privilege is needed for a user to create indexes in oracle?
What are ddl statements in oracle?
what is the difference between substr and instr function in oracle?
What is varray?
Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.
15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.
How a database is related to tablespaces?
Explain how you would restore a database using RMAN to Point in Time?
What are the various constraints used in oracle?
What are the differences between primary key and unique key?
HI ALL, CAN ANYONE TELL ME THE DIFFERENCES BETWEEN SQL CLUSTURS,MSQL CLUSTERS,ORACLE CLUSTERS.......THANKS IN ADVANCE
Can we write dml statement in function in oracle?
How to use "startup" command to start default instance?