select 仓库,物品,出库量 from (
select 仓库,物品,出库量,2 flag from 你的表
union all
select 仓库,null,sum(出库量),1 from 你的表 group by 仓库) tem order by flag