SELECT id, `name`, score FROM ( SELECT g.id, `name`, score, DENSE_RANK() over ( PARTITION BY `name` ORDER BY score DESC ) AS ranking FRO...