mysql limit分页技术注意问题


 limit 语法:

              select *from table limit 值1,值2

注意:值1,值2不能为表达式或者变量

否则将会出错

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '(1-1)*3,3'

at line 1。

这种写法不会出错:

猜你喜欢

转载自1309010241.iteye.com/blog/2398969