Mysql 5.7 rank報錯
場景:
在mysql5.7版本執行rank函數時報錯,報錯如下:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select id,salary,rank() over(order by salary desc) from employee' at line 8
解決:
經查詢Mysql5.7版本並沒有支持該rank函數,但在8版本測試已經可以使用,說明mysql8以後的版本已經支持該rank函數。