I'm getting an error where it says

Error: near line 3: near "DESC": syntax error

My code is

SELECT title, rating FROM movies JOIN ratings ON movies.id = ratings.movie_id WHERE year = 2010
    WHEN rating = rating THEN title
    ELSE rating DESC

Is this a problem with the CASE that I'm using or is this an error with the syntax I'm using

1 Answer 1


ORDER BY can take multiple criteria so all I needed was ORDER BY rating DESC, title and not the CASE.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .