MySQL 的 LIMIT 后只能跟准确数字,不能使用表达式

如:

select * 
from `tab`
limit 2, 5;

而这种写法会报错

select * 
from `tab`
limit (3-1)*5, 5;

在写分页SQL时注意一下

 

相关文章: