Friday, 22 April 2016

How to display nth highest record in a table ?


Display Nth highest record
SELECT salary FROM employee ORDER BY salary DESC LIMIT (n-1)

Question. How to display 4th highest salary record from employee table ?
SQL : SELECT salary FROM employee ORDER BY salary DESC LIMIT 3,1

No comments:

Post a Comment

Note: only a member of this blog may post a comment.