医药CRM系统开发

自已做医药CRM系统有四年了,终于可以算个产品了,努力市场化,今年重种将医药营销的理念加入CRM

导航

根据库存上下限生成对比单(世通)

Posted on 2007-03-19 16:03  hhq80  阅读(257)  评论(0编辑  收藏  举报
select t.ypm,t.gg,t.cd,t.zxdw,t.nbbm,m.dwmc,m.bzdj,t.sysl+t.bysl-t.bfsl as kcs,t.kcxx from
(select
(select ypm from zy_sys2_ypzdk b where b.nbbm=a.nbbm) as ypm,
(select gg from zy_sys2_ypzdk b where b.nbbm=a.nbbm) as gg,
(select cd from zy_sys2_ypzdk b where b.nbbm=a.nbbm) as cd,
(select zxdw from zy_sys2_ypzdk b where b.nbbm=a.nbbm) as zxdw,
 a.nbbm,a.sysl,a.bysl,a.bfsl,a.kcxx from ZY_YP1_YKSZ a where sysl+bysl-bfsl<=kcxx) as t
left join
(select distinct nbbm as nbbm1,
(select dmmc from zy_sys2_cgdw c where c.dm=a.dw) as dwmc,
a.dw,
bzdj from zy_yp1_sfmx  a where cfbj='t' and a.jzrq=(select max(jzrq) from zy_yp1_sfmx b where cfbj='t' and a.nbbm=b.nbbm )) as m
on t.nbbm=m.nbbm1