這個(gè)表,我想查詢出來左邊是從大到小排列 右邊是排名。我這么寫的語句為什么不對(duì)啊,?select?score,(select?count(*)?from?(select?distinct?score?from?scores?group?by?score?order?by?score?desc)?as?s2?where?s1.score?>=?s2.score)?as?rank
?from?(select?distinct?score?from?scores??order?by?score?desc)?as?s1這是報(bào)錯(cuò):
1 回答
已采納

pardon110
TA貢獻(xiàn)1038條經(jīng)驗(yàn) 獲得超227個(gè)贊
rank是sql的保留關(guān)鍵字,不允許使用如果一定要用請(qǐng)加上` 號(hào)
添加回答
舉報(bào)
0/150
提交
取消