我最近将我的MariaDB 5.5升级到了MariaDB 10.3.14,以便能够使用10.2之后引入的RANK()OVER函数。
经过升级过程后,我仍然收到与5.5相同的语法错误消息。
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RANK() OVER (
ORDER BY
at line 2
我试图了解为什么在升级后仍然出现相同的错误。 这是我正在使用的查询:
SELECT member_id, total_pts, correct_predictions, correct_goals
RANK() OVER (
ORDER BY
total_pts DESC,
correct_predictions DESC,
correct_goals DESC
) rank
FROM quiniela_1;
我在做什么错了?
答案 0 :(得分:0)
在SELECT member_id, total_pts, correct_predictions, correct_goals
之后加上逗号,以便您的查询显示为:
SELECT member_id, total_pts, correct_predictions, correct_goals,
RANK() OVER (
ORDER BY
total_pts DESC,
correct_predictions DESC,
correct_goals DESC
) rank
FROM quiniela_1;