mysql下limitselect userid from usertbl where 11 limit (3-2)*2,2为什么这样写报错。[解决办法]set @as
mysql下limit
select userid from usertbl where 1=1 limit (3-2)*2,2;为什么这样写报错。
[解决办法]
set @asql=concat('select userid from usertbl where 1=1 limit ',(3-2)*2,',2');
prepare stml from @asql;
execute stml;
[解决办法]
limit 后仅支持常数,不能是变量或者表达式。
