分页的一个问题
这是一次查询
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 协议》,转载必须注明作者和本文链接
推荐文章: