Query to get max and second max in oracle in one query ?
Answer Posted / sarmistha mohanty
select * from (
select SAL,
row_number() over (partition by 1 order by SAL DESC)
as rank
from <table name> ) where rank in (1,2)
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
How to create lov dynamically at runtime & attach to text field?
What is the difference between count (*), count (expression), count (distinct expression)?
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 is a read only transaction in oracle?
What is pragma autonomous transaction in oracle?
Define oracle database
How to invoke the data pump export utility?
What is a read write transaction in oracle?
What are the different types of trigger and explain its various uses and functions?
We are using Oracle apps with XML publisher.In that,we are facing some problems while giving a Footer in RTF Template.While giving a footer in RTF Template it is Visible in all the pages,but after the PDF is getiing generated,the Footer are Visible on alternate pages only (like on first page ,third page) and so on. Please provide the Solution for getting the Footer on all the pages.
How to view all columns in an existing table?
WHAT IS ecc 6.0
Explain a private synonyms?
Explain the use of tables option in exp command.
How to open a cursor variable?