Query to get max and second max in oracle in one query ?
Answer Posted / bhanu yadav
For Nth Max.
select distinct a.sal from emp a where &N= (select count
(distinct b.sal) from emp b where b.sal>=a.sal)
For Nth Min.
select distinct a.sal from emp a where &N= (select count
(distinct b.sal) from emp b where b.sal<=a.sal)
| Is This Answer Correct ? | 9 Yes | 6 No |
Post New Answer View All Answers
How would you best determine why your MVIEW couldnt FAST REFRESH?
What is a database table in oracle?
What are the system predefined user roles?
Respected sir, Please send me technical questions related to oracle apps..
How to delete all rows a table in oracle?
What is a trigger and what are its types?
What are the ansi data types supported in oracle?
Who developed oracle & when?
What is oracle sid?
How to write date and time literals in oracle?
what is IDE,DMV in sql server?
I creat Credit memo in AR. Now i want revers the Credit Memo.how you can revers that what out any aditional entry.
What is archive log in Oracle?
how to join query for one source type is oracle another source type is sql server ?
What is an Oracle Instance?