Let\'s say I have the following table:
category | guid ---------+----------------------- A | 5BC2... A | 6A1C... B | 92A2...
Assuming you're using SQL Server 2005 or later:
;with Numbered as ( select category,guid,ROW_NUMBER() OVER (PARTITION BY category ORDER BY guid) rn from myTable ) select * from Numbered where rn=1