我想排列以下得分表,其中相同的得分將具有相同的等級。rank()函數SQL
+----+-------+
| Id | Score |
+----+-------+
| 1 | 3.50 |
| 2 | 4.00 |
| 3 | 4.00 |
| 4 | 3.50 |
+----+-------+
有人可以幫助爲什麼是以下查詢拋出語法錯誤?另外,邏輯不正確?
代碼:
select Score, RANK() OVER (order by Score desc) as rank
from Scores
order by Score desc;
錯誤消息:
Line 1: SyntaxError: near '(order by Score desc) as rank
from Scores
order by Score desc'
MYSQL犯規支持窗口功能尚未 – GurV
啊哈相關的一些注意事項 - 這就是了。謝謝! –