"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Tuesday, May 24, 2011

Find the fifth highest salary in Salary Table

Its a very common interview question.Actually its very simple here it goes:

SELECT MIN(Salary) AS Expr1 FROM tblEmployee 
WHERE (empid IN (SELECT DISTINCT TOP 5 empid FROM tblSalary ORDER BY Salary))

Stay tune...
Have a nice day... 'N happy Coding :)

No comments: