What is wrong with my solution?


  • 0
    S
    SELECT Scores.Score AS Score, IFNULL(q3.Rank, 0)+1 AS Rank
        FROM Scores
        LEFT JOIN 
             (SELECT q1.Score AS Score, COUNT(*) AS Rank
                FROM (SELECT Scores.Score AS Score
                        FROM Scores
                        GROUP BY Score
                        ORDER BY Score DESC) AS q1
                JOIN
                     (SELECT Scores.Score AS Score
                        FROM Scores
                        GROUP BY Score
                        ORDER BY Score DESC) AS q2
                ON q1.Score < q2.Score
                GROUP BY Score
                ORDER BY Score DESC) AS q3
        ON q3.Score = Scores.Score
        ORDER BY Score DESC
    

    I get internal error while running it. Runs fine on SQLzoo!


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.