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;