Here is the query to find the Nth max salary of an employee:
SELECT distinct(salary) from employee order by salary desc limit(n-1,1);
like for 3rd highest salary query will be:
SELECT distict (salary) from employee order by salary desc limit(2,1);
Thursday, April 24, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment