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 what are the characteristics of data files?
An automatic job running via DBMS_JOB has failedKnowing only that its failed, how do you approach troubleshooting this issue?
What is the difference between truncate & delete command?
Hi this srilatha. I comlpeted my Oracle-hrms. can u provide me interview questions on Core hr, payroll,sshr,OLM etc..
What are the uses of linked server and explain it in detail?
What is a data dictionary and how can it be created?
What is the difference between hot backup and cold backup in oracle?
How to define an explicit cursor in oracle?
List the various oracle database objects?
What is Reduced List of Values?
How to pass parameters to procedures?
can anyody please send me the dump for Oracle 10g certifications for DBA path?
How do I uninstall oracle client from windows?
Whether any commands are used for months calculation? If so, what are they?
When do we use group by clause in a sql query?