WITH normalizedMap AS (
SELECT
REGEXP_REPLACE(name, '\\s+', ' ', 1, 0) AS normalized_name,
COUNT(*) OVER (PARTITION BY REGEXP_REPLACE(name, '\\s+', ' ', 1, 0)) AS cnt,
id AS player_id
FROM players
)
UPDATE players p
INNER JOIN normalizedMap n ON n.player_id = p.id
SET p.name = n.normalized_name
WHERE n.cnt = 1;