select a,max(b) from a group by a或者select a1.a,b from a as a1 where b = (select top 1 b from a where a.a = a1.a)