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 highest salary

802304Jun 2 2011 — edited Oct 14 2011
Hello,

I am using below query for second highest salary

select * from a_test e where 2 =(select count(distinct sal) from a_test where e.sal<=sal)

can anybody plz describe how where 2=.... works

what is the meaning of 2
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 11 2011
Added on Jun 2 2011
11 comments
38,165 views