它不喜欢下面的limit
行。在这种情况下,我如何使用变量@row
来限制结果集?
SELECT @row := 5;
SELECT * FROM MyTable
limit @row
错误:
Unexpected '@row'
最佳答案
The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be nonnegative integer constants https://dev.mysql.com/doc/refman/8.0/en/select.html
所以,
SELECT * FROM MyTable
limit 5
关于mysql - 使用变量 mysql 无法按预期工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51621990/