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
What is the best way to do multi-row insert in oracle?
What privilege is needed for a user to create views in oracle?
Hi Masters, in Oracle Applications 11i, we hace 2 functions using the same form, i need to create 1 personalization, but that code must afect only one function.... how can i do that?
How to insert multiple rows with one insert statement in oracle?
Whether any commands are used for months calculation? If so, what are they?
How to import one table back from a dump file?
> CREATE OR REPLACE FUNCTION FACTORIAL_1(factstr varchar2 ) 2 RETURN NUMBER AS 3 new_str VARCHAR2(4000) := factstr||'*' ; 4 fact number := 1 ; 5 BEGIN 6 7 WHILE new_str IS NOT NULL 8 LOOP 9 fact := fact * TO_NUMBER(SUBSTR(new_str,1,INSTR(new_str,'*')-1)); 10 new_str := substr( new_str,INSTR(new_str,'*')+1); 11 END LOOP; 12 13 RETURN fact; 14 15 END; explanation Above program?
List the various oracle database objects?
How to handle a single quote in oracle sql?
How to use "in out" parameter properly?
What are the differences between blob and clob in oracle?
What happens to the data files if a tablespace is dropped?
What is a sub query? What are its various types?
what's query optimization and without use of IN AND Exist can we get another way data from query
What are the tools for Oracle ?