UPDATE  kc
SET     kc.Kcsl = kc.Kcsl - ph.sl ,
        kc.Djsl = kc.Djsl - ph.sl
FROM    XT_YP_KCXXK kc ,
        mz_cf cf ,
        mz_cfmx mx ,
        mz_cfmxph ph
WHERE   mx.cfnm = @outpPresMainID
        AND kc.Ksdm = @deptCode
        AND mx.cfnm = ph.cfnm
        AND mx.yp = ph.yp
        AND mx.yp = kc.Ypdm;

 

posted on 2017-08-19 23:49  幻影K  阅读(801)  评论(0编辑  收藏  举报