select col1,sum(col2) as col2 from tb 
group by col1

解决方案 »

  1.   

    select col1,col2=sum(col2) from tb group by col1
      

  2.   

    糟糕
    我是在access,是不是不行哦
    我开始也是这样写的
      

  3.   

    ACCESS2000:
    SELECT [tb1].[col1], Sum([tb1].[col2]) AS col2
    FROM tb1
    GROUP BY [tb1].[col1];
      

  4.   

    hdhai9451(※★開拓者...前進☆※) 
    要你试了才知道
      

  5.   

    create table t(name1 char(4),value int)
    insert into t
    select 'a','1' union all
    select 'b','2' union all
    select 'b','3' union all
    select 'a','4' union all
    select 'c','1' union all
    select 'c','1' 
    goselect name1,sum(value)
    from t
    group by name1drop table t