你用的那个in操作估计是慢的原因,如果你的in内的数据很多的话会非常 的慢的!

解决方案 »

  1.   

    try:update T_CJ_ZZSJCJ a set (SL0,SL)=(
       select SL0,SL from T_JK_CL_CJ_ZZSJCJ 
       where CJRQ=a.CJRQ and LB=a.LB and DW=a.DW and SJLB=a.SJLB and RCBJ=a.RCBJ and 
             SJBM=a.SJBM and BZLX=a.BZLX and DW2=a.dw2 and YSFS=a.ysfs)
    where exists (
           select 1 from T_JK_CL_CJ_ZZSJCJ 
       where CJRQ=a.CJRQ and LB=a.LB and DW=a.DW and SJLB=a.SJLB and RCBJ=a.RCBJ and 
             SJBM=a.SJBM and BZLX=a.BZLX and DW2=a.dw2 and YSFS=a.ysfs);
      

  2.   

    用这句看能不能提高一些速度!
    update T_CJ_ZZSJCJ a set (SL0,SL)=(
       select SL0,SL from T_JK_CL_CJ_ZZSJCJ 
       where CJRQ=a.CJRQ and LB=a.LB and DW=a.DW and SJLB=a.SJLB and RCBJ=a.RCBJ and 
             SJBM=a.SJBM and BZLX=a.BZLX and DW2=a.dw2 and YSFS=a.ysfs)
    where exist
           (
           select 'X' from T_JK_CL_CJ_ZZSJCJ b where a.CJRQ=b.CJRQ and a.LB=b.LB ,.....)