问题一,Group 不分顺序,无论谁在前,结果都是一样的。问题二, 其他列要用 Aggregation 函数显示,例如SUM, MAX 

解决方案 »

  1.   

    1.那group相当于只能按一列group了?,但还是实现不了我想要的2.按weiyue_net 说的成功了,只要max(任意列)就可以实现了.
      

  2.   

    ACCESS ADO访问时是JET-SQL JET-SQL 参考 (如安装OFFICE选择帮助,则直接访问本机)
    C:\Program Files\Common Files\Microsoft Shared\OFFICE11\2052\JETSQL40.CHM

    JET-SQL 参考 
    http://download.csdn.net/source/351771Access使用的是Jet-SQL。 JET SQL 帮助(jet4 access2000)下载地址 
    http://www.access911.net/index.asp?board=8&recordid=75FAB71E&tt= [align=center]====  ====
    [/align]
      

  3.   

    create table #tab1(id1 int null,id2 int null,id3 int null) 
    go
    insert into #tab1(id1,id2,id3)
    select id1,id2,id3 from 
    (
    select 1 as id1,1 as id2,1 as id3 union 
    select 1,2,3 
    ) as tab
    go
    create table #tab(id1 int null,id2 int null,id3 int null)
    go
    declare @id1 int 
    declare curst cursor static for
    select id1 from #tab1 group by id1
    open curst
    fetch next from curst into @id1
    while @@fetch_status = 0 
    begin
    insert #tab(id1,id2,id3) select top 1 id1,id2,id3 from #tab1
    fetch next from curst into @id1
    end
    close curst
    deallocate curst
    select * from #tab
    go
    drop table #tab1
    drop table #tab
    go
      

  4.   

    问题1补充:先按id1分组汇总即group by id1   
    假如以上结果集为A然后再按id2汇总A