TABLE A
Acol      Bcol     Ccol
 1         ww      
 2         dd
 3         ss 
.....TABLE B
.........Ccol
          aa
          xx
........ 
如图:
现在我想要把B表中Ccol的值批量更新到A表中Ccol中如何操作!!!
希望不要用存储过程!!!!一定给分啊!

解决方案 »

  1.   

    update a set a.Ccol=(select  b.Ccol from b where b.Acol=a.Acol);
      

  2.   

    A的Ccol和B的Ccol怎么关联?如果有关联,可以用merge into来做
    比如
    merge into a t1 
    using b t2
    on (t1.id=t2.id)
    when matched then update t1 set t1.ccol=t2.ccol
      

  3.   

    如果数据量大的话可以使用以下方案,performance会好很多:
    create new_table tablespace ts_name as
    select a.c1.., b.cl1.. from a, b
      

  4.   


    t1.id=t2.id
    这个也是关联呀!怎么说没有关联呢?
      

  5.   

    我的TABLE B中就不存在ID这个字段,这个字段是后面各位大侠 自己加的!
    谢谢