Showing posts with label 3rd. Show all posts
Showing posts with label 3rd. Show all posts

Monday, June 16, 2008

how to find the 2nd, 3rd ,4th ... nth highest salary of the employee from emp table?

select sal from emp e1 where (n-1)=(select count(DISTINCT sal)
from emp where sal > e1.sal )