update table1
set table1.B=table2.C
where table1.a in (
   select table2.a
   from table2
)

解决方案 »

  1.   

    楼上的写话是错误的.最好的方法是写个过程.使用游标来更新.单条UPDATE语句实现起来好象有点难.
      

  2.   

    我试出来了,应该这样写:
    update lgxa set lgxa.b=(select lgxb.c from lgxb  where lgxb.a=lgxa.a);
      

  3.   

    update table1 t1 set b=(select c from table2 t2 where t2.a=t1.a and rownum=1)
    加rownum=1条件只是为了保险,如果a是主键的话,则不用加该条件
      

  4.   

    如果a是主键的话,可以试一下这么写。update (select tb1.b,tb2.c 
            from table1 tb1,table2 tb2 
             where tb1.a=tb2.a) 
       set b=c