Anjali
Anjali

Reputation: 13

Why am I getting such an error using keyword of MYSQL

Table name : Scores

Code:

select s1.score 

from Scores s1
order by DESC;

Error :

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

Upvotes: 0

Views: 60

Answers (1)

zealous
zealous

Reputation: 7503

You have to mention which column name you want to Order By. You are missing the column name and that what the error is. try the following.

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

Upvotes: 2

Related Questions