sql:
select * from 表A order by 字段a desc limit?,?
当字段a会出现相同值排序时,再结合limit使用会导致分页的数据有重复
处理方法:在需要排序的字段加上唯一的字段一起排序
eg:
select * from 表A order by 字段a+id desc limit?,?
记录JAVA-order by和limit一起使用会导致数据错乱
最新推荐文章于 2023-06-02 22:49:04 发布