I am a noob in programming and I found this code block from a discussion page on leetcode that I find really difficult to understand:
SELECT
Score,
@rank := @rank + (@prev <> (@prev := Score)) Rank
FROM
Scores,
(SELECT @rank := 0, @prev := -1) init
ORDER BY Score desc
Any explanation would be very helpful for my understanding.