Wednesday, May 30, 2012

Nth highest Salary from the Employee table


Select * from emp e1 where in (select count (distinct e2.sal) from emp e2 where e2.sal >= e1.sal) = &n

// where n= 1,2,3,4,....
(nth highest Salary) 

No comments:

Post a Comment

Comments

Protected by Copyscape Plagiarism Software