Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Second/fourth max

bala1Mar 9 2009 — edited Mar 9 2009
Hi all,

find the second and fourth maximum salary for each employee no.

This is my table structure:
EMPNO SAL 
1 1000 
1 2000 
1 3000 
1 500
2 3000 
2 2100 
2 1100 
2 400
I want to get the output like this:
empno sal  max_sal_position
1       2000   2
1       500     4
2       2100   2
2       400     4
This post has been answered by Walter Fernández on Mar 9 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 6 2009
Added on Mar 9 2009
4 comments
210 views