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 define and use table alias names in oracle?
How to write date and time literals in oracle?
Can we commit inside a function in oracle?
What do you mean by redo log file mirroring?
How to create tables for odbc connection testing?
Explain user account with reference to oracle.
How to call a sub procedure?
What is java oracle used for?
Explain coalesce function?
What is flashback in Oracle?
How do I use unicode codesets with the weblogic jdriver for oracle driver?
What are the arithmetic operations?
How to create a server parameter file?
How to bring a tablespace offline?
Is truncate autocommit in oracle?