Query to get max and second max in oracle in one query ?
Answer Posted / shareef
select ename,empno,sal,r from(select ename,empno,sal,dense_rank() over(order by sal desc) r from emp) where r=3; ----by using dense_rank()
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Give the various exception types.
What is recovery manager(rman) backup in Oracle?
Why oracle is used?
Difference between oracle's plus (+) notation and ansi join notation?
What is Segment Advisor in Oracle?
Who developed oracle & when?
Can we protect our pl/sql source code?
How different is ms access and oracle?
How to filter out duplications in the returning rows using oracle?
What are the four Oracle system processes that must always be up and running for the database to be useable?
What are the different windows events activated at runtime ?
how do u setup a replication site?
What is an oracle wallet?
How to define and use table alias names in oracle?
> 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?