0

I am trying to rank a table of scores using MySQL using the following code:

select score1 as score, count(score1) as rank
from
(select s1.score as score1, s2.score as score2
from scores as s1, scores as s2
where s1.score <= s2.score) as nums
group by score1

I am getting a syntax error near 'rank' but when I remove the "as rank" phrase or replace the alias with something else like "as r", it works. Why is it giving an error when I use the word "rank"?

0 Answers0