select * from tablename x
where b=(
select min(b) from tablename 
where a=x.a
)

解决方案 »

  1.   

    需要的话加
    order by a
      

  2.   

    select a.* from table1 a,(select a, min(b) as b from table1 group by a
    ) b where a.a=b.a and a.b=b.b
      

  3.   

    select * from table1
    where b = ( select min(b) from table1 group by a )
      

  4.   

    select * from table1 b
    where b = ( select min(b) from table1 where b.a = a group by a )
      

  5.   

    我用select distinct a.* from table1 a ,(select a,min(b) from table1 group by a) b
    where a.a=b.a and a.b=b.b