求一个sql表的分类求和语句

2024-12-28 07:36:06
推荐回答(4个)
回答1:

select name,code,sum(number) from Table group by name,code

回答2:

select
[name] as 姓名,code as 代码,sum(number) as 数量
from tablename
group by [name]

回答3:

二楼的正确

回答4:

select name,
code,sum(number) from Table
group by name,code