update t2 set c_name2=t1.c_name2  from 表a t1,表b t2 where t1.c_dm=t2.c_dm2

解决方案 »

  1.   

    update b set c_dm2=c_dm from a,b where a.c_name2=b.c_name2
      

  2.   

    update B
    set c_dm2=A.c_dm
    from B
    join A on A.c_dm=B.c_dm1 and B.c_name1=A.c_name1
      

  3.   

    update b 
     set c_name1=xy.c_name1,
         c_dm2=xy.c_dm2,
         c_name2=xy.c_name2
    from 
      b,
      (select x.c_dm as c_dm1,x.c_name1 as c_name1,
             y.c_dm as c_dm2,y.c_name2 as c_name2   
      from 
         (select a.c_dm ,a.c_name1 
         from 表A a where  trim(c_name2) is null)  x,
        ( select a.c_dm ,a.c_name1,a.c_name2  
         from 表A a1    where  trim(c_name2) is not null) y   
      where  x.c_name1=y.c_name1) xy
    where b.c_dm1 =xy.c_dm1
      

  4.   

    update t2 set c_dm2=t1.c_dm  from 表a t1,表b t2 where t1.c_name2=t2.c_name2
      

  5.   

    update t2 set c_name2=t1.c_name2  from 表a t1,表b t2 where t1.c_dm=t2.c_dm2
      

  6.   

    updae B set c_dm2=A.c_dm from A ,B where A.cname2=B.cname2 and A.cname1=B.cname1
      

  7.   

    update B set c_dm2=A.c_dm from A,B 
    where A.c_name1=B.c_name1 and A.c_name2 is not null
      

  8.   

    经过测试,我的是正确的,请记住我---csdn里的霸王棍,耶!!!!!!