select * from 表 aawhere b=(select top 1 b from 表 where a=aa.a)

解决方案 »

  1.   

    select * from #T as a
    where (select top 1 b from #t where a = a.a) = b
      

  2.   

    select a,min(b)
    from tablename
    group by a
      

  3.   

    select distinct a, b from table
      

  4.   

    select * from #T as a
    where (select top 1 b from #t where a = a.a) = b
      

  5.   

    select a.a,b=(select top 1 b from 表 where a=a.a)
    from 表 a
    group by a.a
      

  6.   

    select a,min(b)
    from tablename
    group by a这样很好啊,为什么不用!
      

  7.   

    hglhyy(查無此人) 你回答错拉
    2               3
    2               1
    2               8
    按你的语句结果是
    a     b
    1     2
    2     1
    3     5