MySql offset query not working

时光毁灭记忆、已成空白 提交于 2021-02-05 09:46:16

问题


I have MySql Workbench 6.2CE (hope this helps..) And I'm trying to an offset query like this :

SELECT id FROM nameTable OFFSET 10 ROWS; 

But it give me a syntax error on the 10 : is not a valid input in this position. Anyone knows the problem ?Thank you!


回答1:


The syntax is wrong and its

select * from table order by someid
[LIMIT {[offset,] row_count | row_count OFFSET offset}]

https://dev.mysql.com/doc/refman/5.0/en/select.html

Note that limit without order by is having no meaning.

SELECT id FROM nameTable order by id limit 10 OFFSET 10


来源:https://stackoverflow.com/questions/30319131/mysql-offset-query-not-working

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!