分页的一个问题
这是一次查询
SELECT DISTINCT
( sj_mobile.id ) AS id,
`sj_mobile`.`name`,
`sj_mobile`.`mobile_brand_id`,
`sj_mobile`.`sort`,
`sj_mobile`.`image`
FROM
`sj_mobile`
WHERE
`sj_mobile`.`delete_time` IS NULL
ORDER BY
`sj_mobile`.`sort` DESC
LIMIT 10 OFFSET 30
这也是一次查询
SELECT DISTINCT
( sj_mobile.id ) AS id,
`sj_mobile`.`name`,
`sj_mobile`.`mobile_brand_id`,
`sj_mobile`.`sort`,
`sj_mobile`.`image`
FROM
`sj_mobile`
WHERE
`sj_mobile`.`delete_time` IS NULL
ORDER BY
`sj_mobile`.`sort` DESC
LIMIT 10 OFFSET 20
这里用的是sort排序 但是sort全是0 为什么数据会有重复的啊
本作品采用《CC 协议》,转载必须注明作者和本文链接
有没可能你的sort 都是 0
排序加个id
vsalw.com/9768.html
什么重复?排序字段值一样,就会随机数据出来的