select productno,productname,min(type) as type from tb group by productno,productname
select * from tablename a where exists(select 1 from tablename where type=a.type and productno>a.productno)
select T.* from T inner join (select min(productno) as productno,type from T group by type) A on T.productno=A.productno and T.type=A.type
declare @a table(pikd int identity(1,1),productno nvarchar(30),productname nvarchar(40),type nvarchar(30))insert @a select * from Yourtableselect * from Yourtable a inner join (select max(Pkid) Pkid from @a group by type) b on a.PKID = b.PKID
select T.* from T
inner join
(select min(productno) as productno,type from T group by type) A
on T.productno=A.productno and T.type=A.type
select * from Yourtableselect * from Yourtable a
inner join
(select max(Pkid) Pkid from @a
group by type) b
on a.PKID = b.PKID