why this only pass 5 cases out of 10 ? help please.


  • 0
    F
    SELECT Score , CASE
    WHEN @prev_value = Score THEN @rank
    WHEN @prev_value := Score THEN @rank := @rank +1
    END AS Rank
    FROM Scores,
    ( SELECT @prev_value := NULL, @rank := 0 ) init
    ORDER BY Score DESC;
    

Log in to reply
 

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