, col3 col1:
select t.*
from @t t
inner join (
select col1, mincol3 = min(col3)
from @t
group by col1
) filter
on t.col1 = filter.col1
and t.col3 = filter.mincol3
(col1, col3), .
:
declare @t table (id int, col1 varchar(max), col2 varchar(max),
col3 varchar(max))
insert into @t
select 0, 'Goat', '10', '0'
union select 1, 'Cat', '11', '0'
union select 2, 'Goat', '12', '1'
union select 3, 'Mouse','13', '0'
union select 4, 'Cat', '14', '2'