How to display nth highest record in a table for example How to display 4th highest (salary) record from customer table.

December 24, 2009 | Filed Under MySQL | Leave a Comment

Query: SELECT sal FROM `emp` order by sal desc limit (n-1),

1If the question: “how to display 4th highest (salary) record from customer table.”The query will SELECT sal FROM `emp`

order by sal desc limit 3,1

Comments

Leave a Reply





© PHPInterviewQuestion.com 2009 - 2010

eXTReMe Tracker