日期:2014-05-17 浏览次数:20534 次
select count(1) count from v_instock a left join v_stockstatic b on a.cinvcode=b.cinvcode where b.iQuantity >0
and datediff(day,a.dpodate,GETDATE()) > (select times from hq_pm_timeset)
and not exists (select distinct cinvcode from v_hq_record c1 where c1.cinvcode=a.cinvcode);
select count(1) from v_instock a where
not exists (select distinct cinvcode from v_hq_record c1 where c1.cinvcode=a.cinvcode)
and exists
(
select * from v_stockstatic b where a.cinvcode=b.cinvcode
and b.iQuantity >0
and datediff(day,a.dpodate,GETDATE()) > (select times from hq_pm_timeset)
)