mysql order by .. limit.. 笔记

当数据库中数据都为0的时候 使用order by  limit start limt sql语句时候  注意mysql

 order by   limit 0,10 与 order by limit 10,10会出现重复数据,新版的mysql会有这个问题sql

the differences in that between MariaDB 5.5.50 and 10.1 数据库

加上 id就能够避免这个问题code

You do not specify which ten first rows you want to obtain. As there are a lot of rows for which published equals 0 MariaDB is free to choose some of them. If you want a specific order try:ci

SELECT advert_id, published, id FROM vacancies ORDER BY published asc, id LIMIT 10;
相关文章
相关标签/搜索