The content of this article:
Mysql Limit Offset Example
Example 1, suppose that there are 13 data in the database table student.
code example:
Statement 1:select * FROM student limit 9,4
Statement 2:slect * FROM student limit 4 offset 9
Statements 1 and 2 return rows 10th, 11, 12, 13 of the table student
4 in Statement 2 returns 4 rows, 9 means starting from row tenth of the table
Example 2, the paging function can be achieved by limit and offset or by limit only.
Assuming that numberperpage represents the number of bars to display per page, pagenumber represents the page number, then return to page pagenumber, the SQL statement with the number of numberperpage per page:
code example:
Statement 3:select * FROM studnet limit (pagenumber-1) *numberperpage,numberperpage
Statement 4:select * FROM student limit numberperpage offset (pagenumber-1) *numberperpage
Reprint: http://blog.csdn.net/iastro/article/details/53037600
Mysql Limit Offset Usage example