update ta set ta1=(select tb1 from tb where tb2=ta.ta2)

解决方案 »

  1.   

    update ta set ta1=(select tb1 from tb where tb2=ta.ta2) where ta2 in (select tb2 from tb)
      

  2.   

    可以用如下写法:
    update ta set ta1=(select tb1 from tb where tb2=ta.ta2)
                      ------------------------------------- (先选出来,再更新)
      

  3.   

    update ta a set ta1=
         (select tb1 from tb b where a.ta2=b.tb2)