SELECT
name,MIN(id_num)
FROM YourTable
GROUP BY name
अद्यतन करें: यदि आप यादृच्छिक रूप से id_num चुनना चाहते हैं, तो आप इसे आजमा सकते हैं
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