Query to get max and second max in oracle in one query ?
Answer Posted / satish
SELECT SAL SECOND_MAX_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
You have found corruption in a tablespace that contains static tables that are part of a database that is in NOARCHIVE log mode. How would you restore the tablespace without losing new data in the other tablespaces?
What are the various types of snapshots ?
How to start your 10g xe server from command line?
what is meant by magic query
Explain the use of owner option in exp command.
Explain do view contain data?
How to create a table in a specific tablespace?
How to rollback the current transaction in oracle?
Why does for update in oracle 8 cause an ora-01002 error?
Point out the difference between user tables and data dictionary?
How to use subqueries in the from clause in oracle?
What is the use of file param in imp command?
What is a partition in oracle?
What is literal?
Explain index?