select min(a.id) as id , a.uid, a.sort from product a, (select uid, max(sort) as sort from product group by uid) b where a.uid = b.uid and a.sort = b.sortgroup by a.uid, a.sort...
select max(id) as id,uid,sort From ProductsWhere rtrim(cast(uid as varchar(5)))+ltrim(cast(sort as varchar(5))) in(select rtrim(cast(uid as varchar(5)))+ltrim(cast(max(sort) ...