测试:
create table t1(a int,b int)
insert t1 select  1    ,7
union all select  2    ,9
union all select  2   , 6
union all select  3  ,  8
union all select  4 ,   7
union all select  5,    8select t1.* from t1 join(
select b,min(a) as a from t1 group by b) aa
on t1.b = aa.b
order by aa.a,aa.ba           b           
----------- ----------- 
1           7
4           7
2           6
2           9
3           8
5           8(所影响的行数为 6 行)