WITH [TableWithRowNumber]
AS
(
SELECT
[IndexID],
[Name],
ROW_NUMBER() OVER (PARTITION BY [IndexID] ORDER BY NEWID()) [RowNumber]
FROM
[SuggestedNames]
WHERE
[CatID] = @CatID
)
SELECT
[IndexID], [Name]
FROM
[TableWithRowNumber]
WHERE
[RowNumber] = 1
--TABLE IS STRUCTURED AS FOLLOWS
--[Name] [IndexID]
--Alexandra 29
--Bartram 29
--Baldwin 30
--Anastasia 30
--Angelica 31
--Basel 31
--OUTPUT IS AS FOLLOWS
--[Name] [IndexID]
--Alexandra 29
--Anastasia 30
--Basel 31