select tt from (select tt,[id] from book order by [id]) as table
group by tt

解决方案 »

  1.   

    应该这样:
    select id,tt from book group by id,tt order by id desc但其结果未必是你想要的 :(
      

  2.   

    select max(id),tt from book group by tt order by id desc
      

  3.   

    select min(id),tt from book group by tt order by id desc
      

  4.   

    select * from (select id,tt from book group by id,tt) AA order by id desc
      

  5.   

    select min(id) as id, tt from book group by tt order by id
      

  6.   

    select tt from book group by tt order by min(id)
      

  7.   

    select min(id) as id, tt  from book group by tt  order by id
      

  8.   

    显示的错误如下:
    Microsoft OLE DB Provider for SQL Server 错误 '80040e14' 列名 'infoStudy.ID' 在 ORDER BY 子句中无效,因为该列既不包含在聚合函数中,也不包含在 GROUP BY 子句中。 /gaojiao_03.asp,行22 
      

  9.   

    tj_dns(愉快的登山者)
    sky_blue(老衲) 
    说的是对的
      

  10.   

    你用老衲的这个不行吗??
    select tt from book group by tt order by min(id)仔细检查一下!