select top 10 a,min(b) as b,min(c) as c from test group by a

解决方案 »

  1.   

    select top 10 from (select distinct a,b,c from test order by c asc) temp
      

  2.   

    select top 10  * from test group by a
      

  3.   

    请教txlicenhe(马可) min(b)和min(c)在这里的作用是什么?MIN函数不是求最小值的吗
      

  4.   

    select identity(int,1,1) as id,* into #t from testselect top 10 a.a,a.b,a.c 
    from #t a join 
         (  select min(id) as nid 
            from #t 
            group by a
          ) b on a.id=b.nid drop table #t
      

  5.   

    select top 4 a from (select distinct a from 表) a
      

  6.   

    select top 10 a,max(b) as b,max(c) as c from test group by a
      

  7.   

    请教txlicenhe(马可) 和LoveSQL(ligg) :你们给出的方法可以通过
    问题1:我还想ORDER BY C DESC 怎么处理呢,如果直接加上去是不行的
    问题2:你们用的MIN,和MAX在这里是什么用的,和我解释下好么谢谢