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!

Query to find the Nth highest salary..

800675Sep 29 2010 — edited Sep 29 2010
Hi Guys,

I am unable to understand this query which one i got from one website.It is used to find the Nth highest salary of the employee...Can anyone please explain me each and every part of it..

The quey is :

select distinct (a.salary)
from emp a
where 1 = (select count(distinct(salary))
from emp b
where a.salary<=b.salary)

The bold part return what value..is my main question on this query..

Plz help
This post has been answered by Saubhik Banerjee on Sep 29 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 27 2010
Added on Sep 29 2010
7 comments
8,133 views