[求助]sum(数量) 为空变为0的问题 Post By:2013/8/19 18:21:00 [显示全部帖子]
select distinct 颜色,规格,(select sum(数量) from {订单颜色规格表} b where a.颜色=b.颜色 and b.规格=a.规格) as 总数量,(select sum(数量) from {包号登记} c where a.颜色=c.颜色 and c.规格=a.规格) as 已裁数量,(select sum(包号) from {包号登记} d where a.颜色=d.颜色 and d.规格=a.规格) as 已裁包数,总数量-已裁数量 as 待裁数量 from {订单颜色规格表} a