order by create_time desc limit -10,10 mybatis

检查-10,10附近:

check the manual that corresponds to your MySQL server version for the right syntax to use near '-10,10'

发现是这样的:

order by create_time desc limit -10,10

分页查询,怎么可能从-10开始呢

然后看参数

发现currentPage是0,查询当然从第一页开始了。如果当前页是0那么是-10到10,如果当前页是1,就不会报错了。

猜你喜欢

转载自blog.csdn.net/Ciel_Y/article/details/123115130
今日推荐