declare @t table(商品名称 varchar(10),数量 int,税额 numeric(10,1),金额 numeric(10,1))
insert @t select '顺酐1',100,11.0,11.0
union all select '顺酐1',50, 11.0,11.0
union all select '顺酐2',20 ,11.0,11.0
union all select '顺酐2',50 ,22.0,22.0
select * from @t
select * from @t
union all
select 商品名称+'总计',sum(数量),sum(税额),sum(金额)
from @t group by 商品名称+'总计'
order by 商品名称
/*
(所影响的行数为 4 行)