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!

Selecting Max rank from Each Group

Dharani123Sep 30 2016 — edited Oct 10 2016

Hi All,

From this query i want max rank values only.

SELECT empno, deptno, sal,

  DENSE_RANK() OVER (PARTITION BY deptno ORDER BY sal) "rank"

  FROM emp;

o/p:

79341013001
79021022222
79021022222
77821024503
78391050004
78762011001
75662029752
79022030003
77882030003
7900309001
12343012502
78443015003
74993016004
74993016004
76983028505

required o/p :

78391050004
79022030003
77882030003
76983028505
This post has been answered by Frank Kulash on Sep 30 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 28 2016
Added on Sep 30 2016
4 comments
4,755 views