select name,code,sum(number) from Table group by name,code
select [name] as 姓名,code as 代码,sum(number) as 数量from tablename group by [name]
二楼的正确