我无法弄清楚我的语句的语法问题
I can't figure out the syntax issue with my statement
我开始学习 mysql 一个星期,我只是想在 LeetCode 中解决问题
我尝试为第 n 个最高数字编写此代码,但我一直无法理解语法 error.I。
如果有人能拿look.Thanks
就好了
SELECT DISTINCT Salary FROM Employee
ORDER BY Salary DESC
LIMIT N-1,1;
LIMIT
不能接受表达式。它只接受整数。
参见https://dev.mysql.com/doc/refman/8.0/en/select.html:
LIMIT takes one or two numeric arguments, which must both be
nonnegative integer constants, with these exceptions:
Within prepared statements, LIMIT parameters can be specified using ? placeholder markers.
Within stored programs, LIMIT parameters can be specified using integer-valued routine parameters or local variables.
我开始学习 mysql 一个星期,我只是想在 LeetCode 中解决问题 我尝试为第 n 个最高数字编写此代码,但我一直无法理解语法 error.I。 如果有人能拿look.Thanks
就好了SELECT DISTINCT Salary FROM Employee
ORDER BY Salary DESC
LIMIT N-1,1;
LIMIT
不能接受表达式。它只接受整数。
参见https://dev.mysql.com/doc/refman/8.0/en/select.html:
LIMIT takes one or two numeric arguments, which must both be nonnegative integer constants, with these exceptions:
Within prepared statements, LIMIT parameters can be specified using ? placeholder markers.
Within stored programs, LIMIT parameters can be specified using integer-valued routine parameters or local variables.