Home >Database >Mysql Tutorial >MySQL 分页_MySQL

MySQL 分页_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:29:54813browse

bitsCN.com

关于 MySQL 的分页语句。

 1 ## 前 N 条记录 2 SELECT * FROM [TAB_NAME]  3 LIMIT N 4  5 ## 得到表中的第 [N + 1]条 到 [N + M]条 记录,共 M 条 6 SELECT * FROM [TAB_NAME]  7 LIMIT N, M 8  9 ## PAGE_NUM - 当前页10 ## PAGE_SIZE - 每页显示条数11 SELECT * FROM [TAB_NAME] 12 LIMIT ([PAGE_NUM] - 1) * [PAGE_SIZE], [PAGE_SIZE]

 

P.S. TOP 是 MS SQL Sever 的关键字

 

 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn