楼主应该去SQL版提问,不就是一个按照服装名称group吗?
-- 创建表
create table #warehouse(
Warehouse_Id int, -- 仓库id
Clothing varchar(100), -- 服装名
Qty int -- 数量
)
-- 测试数据
insert into #warehouse 
select 1,'a',10 union all
select 1,'a',3 union all
select 1,'b',3 union all
select 3,'c',10 union all
select 3,'a',15  
-- 查询
select clothing as 服装,sum(qty) as 数量 from #warehouse
group by clothing
-- 删除表
drop table #warehouse