偏移不是在MySQL查询工作
问题描述:
OFFSET
不工作偏移不是在MySQL查询工作
SELECT
iContentID,
vTitle,
vContectNo
FROM
`tbl_contact_list`
WHERE
`eStatus` = Active AND `eDeleted` = 0
ORDER BY
`vTitle` ASC OFFSET 0
获得以下错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'offset 0' at line 1
phpmyadmin Version information: 4.0.10deb1
database Server version: 5.5.54-0ubuntu0.14.04.1 - (Ubuntu)
PHP version 7
答
[LIMIT {[offset,] row_count | row_count OFFSET offset}]
你需要一个首先限制指定最大值imum返回的行数。
另请参阅this question了解更多使用细节。
(顺便说一下,OFFSET 0
是不必要的,因为它是默认值)