Hi
we are a problem to finding the third hieghest salary in a table
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Jan 19, 2012, 9:51 AM
Try this...
For 2nd highest salary here n=2
select distinct(salary) from employee A where 2=(select count(distinct(salary)) from employee B where A.salary<=B.salary)
For 3rd highest salary here n=3
select distinct(salary) from employee A where 3=(select count(distinct(salary)) from employee B where A.salary<=B.salary)
Thanks