【Mysql报错】You have an error in your SQL syntax:rank

Mysql 5.7 rank error

Scenario: An error
is reported when the rank function is executed in mysql5.7 version, the error is as follows:
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

Solution:
Mysql version 5.7 does not support the rank function after query, but it can be used in the test of version 8. It means that the rank function is already supported by mysql8 and later versions.

Guess you like

Origin blog.csdn.net/debimeng/article/details/104455123