SELECT
name,MIN(id_num)
FROM YourTable
GROUP BY name
MISE À JOUR : Si vous voulez choisir id_num au hasard, vous pouvez essayer ceci
WITH cte AS (
SELECT
name, id_num,rn = ROW_NUMBER() OVER (PARTITION BY name ORDER BY newid())
FROM YourTable
)
SELECT *
FROM cte
WHERE rn = 1