日期:2014-05-17 浏览次数:20793 次
select s.c_materialid 物料编码,
case
when sum(s.n_dryweight) > 0 and s.c_sw04 is null then
sum(s.n_dryweight)
else
0
end 当日库存
from AG_TP_STOCK s
left join TB_MATERIELMAIN b
on b.c_materielid = s.c_materialid
where s.c_storageid = '20802079'
and b.c_factoryid = '2080'
group by s.c_materialid
select s.c_materialid 物料编码,
sum (case
when s.n_dryweight> 0 and s.c_sw04 is null then s.n_dryweight
else 0 end ) 当日库存