Query to get max and second max in oracle in one query ?

Answer Posted / satish

SELECT SAL FROM (SELECT SAL,DENSE_RANK() OVER(ORDER BY SAL DESC) RANK FROM EMP) WHERE RANK=2;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to delete an existing row from a table in oracle?

645


What to do if the binary spfile is wrong for the default instance?

565


Is it possible to set second Primary Key Constraint in a table in Oracle Database ?

647


How to upsert (update or insert into a table)?

541


What is recovery manager(rman) backup in Oracle?

629






What are the advantages of oracle?

555


How to manage transaction isolation level?

564


What is bulk load in oracle?

597


Explain a segment?

621


what is a Nested Loop join?

1568


How to execute the package in oracle?

572


Differentiate between translate and replace?

633


How to drop an existing view in oracle?

571


What is raw datatype?

595


How do I uninstall oracle 11g?

565