Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 MySQL 5.0 服务器,我正在运行这个查询:
SELECT * FROM deals WHERE expires > "2012-05-25 19:37:58" AND city =2 ORDER BY UIN LIMIT 48 , 57
它正在返回:
显示第 0 - 29 行(总共 57 行,查询耗时 0.0036 秒)
难道我做错了什么?我预计 9 行,48-57 ..
to的第二个参数LIMIT不是偏移量,它是相对于偏移量的长度。所以如果你想要 9 行,那就是LIMIT 48, 9.
LIMIT
LIMIT 48, 9
LIMIT 48 , 57
将显示第 48 条记录之后的 57 条记录。
尝试
LIMIT 48 , 9
http://php.about.com/od/mysqlcommands/g/Limit_sql.htm
LIMIT像这样工作:LIMIT (page - 1) * post_per_page, post_per_page
LIMIT (page - 1) * post_per_page, post_per_page