select * from table1 limit (2-1)*10,10
报错信息
1064 - 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)*10,10' at line 1
select * from table1 limit (2-1)*10,10
报错信息
1064 - 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)*10,10' at line 1
不可以这么写,limit后面带常量;
1.你可以计算好放到limit后面
2. 或者 使用字符串拼接sql语句,(实际也是先计算)