根据出库单补入库单缺失明细

 INSERT INTO KCRKD2(KCRKD2_PJLX,KCRKD2_LSBH,KCRKD2_FLBH,KCRKD2_WLBH,KCRKD2_TSKC,KCRKD2_XGDX,KCRKD2_DDLS,KCRKD2_DDFL,
 KCRKD2_SSSL,KCRKD2_DJ,KCRKD2_JE,KCRKD2_FSSSL1,KCRKD2_FSSSL2,KCRKD2_FSSSL3,KCRKD2_PCH,KCRKD2_BZ)
   SELECT  'I','2428456',KCCKD2_FLBH,KCCKD2_WLBH,KCCKD2_TSKC,KCCKD2_XGDX,KCCKD2_DDLS,KCCKD2_DDFL,
  KCCKD2_SL,KCCKD2_DJ,KCCKD2_JE,KCCKD2_FSL1,KCCKD2_FSL2,isnull(KCCKD2_FSL3,0),KCCKD2_PCH,'掉数据,根据KCCKD2补' FROM  KCCKD2 WHERE KCCKD2_LSBH=2434145 AND KCCKD2_WLBH+KCCKD2_PCH
  NOT IN(SELECT  KCRKD2_WLBH+KCRKD2_PCH FROM  KCRKD2 WHERE KCRKD2_LSBH=2428456) ORDER BY KCCKD2_FLBH

 

posted @ 2024-03-17 11:23  CelonY  阅读(2)  评论(0编辑  收藏  举报