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
What is the sid in oracle?
How to create a new table by selecting rows from another table?
What is a read only transaction in oracle?
What are the different pseudo commands? Explain in general?
what is the scripts in data base?
How to assign values to data fields in record variables?
What are transaction isolation levels supported by oracle?
What is the difference between count (*), count (expression), count (distinct expression)?
How to turn on or off recycle bin for the session?
what is the difference between data migration and production migration.
How to resolve name conflicts between variables and columns?
How do I connect to oracle database?
What are the set operators union, union all, minus & intersect meant to do?
What is a sub query? What are its various types?
Explain integrity constraints?