theHack theHack - 1 month ago 14
MySQL Question

mysql limit range

SELECT name FROM mydb ORDER BY score DESC LIMIT 10


query above will return the first 10 rank,

how to modify the
LIMIT
, or maybe is there another syntax to query the 10th rank until the 20th rank?

Answer

This is really basic stuff. You should use:

SELECT name FROM mydb ORDER BY score DESC LIMIT 10,10;

http://dev.mysql.com/doc/refman/5.5/en/select.html

Comments