update tb1 set tb1.code=tb2.code from tb1,tb2 where tb1.id=tb2.id ;
要求不是用子查询实现,用关联的方式写。 多谢!!

解决方案 »

  1.   

    update tb1 set code=(select code from tb2 where id=tb1.id) where exists (select code from tb2 where id=tb1.id)
    有什么不好吗?
      

  2.   

    update tb1 set code=select b.code from tb2 b where b.id=tb1.id
      

  3.   

    我不求子查询的写法。子查询效果不如直接关联好,看起来也不规整。我只是想知道在oracle中是否有类似的实现方式。
      

  4.   

    好像没有 :)
    跟sqlserver不一样