ACCESS2000: SELECT [tb1].[col1], Sum([tb1].[col2]) AS col2 FROM tb1 GROUP BY [tb1].[col1];
hdhai9451(※★開拓者...前進☆※) 要你试了才知道
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
我是在access,是不是不行哦
我开始也是这样写的
SELECT [tb1].[col1], Sum([tb1].[col2]) AS col2
FROM tb1
GROUP BY [tb1].[col1];
要你试了才知道
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