比如我要对查询的数据进行分页查询;初步思路写法是limit (#{pageno}-1)*#{pagesize},#{pagesize};其中pageno是第几页,pagesize是一页中展示的条数,用这种方法实现分页,但是我发现这种运算的写法会报,如下:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(2-1)*2,2' at line 45
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(2-1)*2,2' at line 45] with root cause
请问该如何解决这个问题,并且还能实现分页效果(传回来的参数pageno必须得是第几页这个,而非具体条数这种情况)。
在此感谢了!
xml映射文件传进的参数应该怎么进行运算
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-