Select * From Employee E1 Where
(N-1) = (Select Count(Distinct(E2.Salary)) From Employee E2 Where
E2.Salary > E1.Salary)
for ex: for 3rd largest salary of an employee, the query is:
Select * From Employee E1 Where
2 = (Select Count(Distinct(E2.Salary)) From Employee E2 Where
E2.Salary > E1.Salary)
No comments:
Post a Comment