为什么我得到这样的错误使用MYSQL的关键字

  • 本文关键字:错误 关键字 MYSQL mysql sql
  • 更新时间 :
  • 英文 :


表名:分数

代码:

select s1.score 
from Scores s1
order by DESC;

错误:

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 'DESC' at line 5

您必须提及您想要Order By的哪个列名。您遗漏了列名,这就是错误所在。

select s1.score 
from Scores s1
order by 
score DESC;

最新更新