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,就不会报错了。
原创
2022-02-24 16:45:27 ·
894 阅读 ·
0 评论