update A SET A.BB= (select B.DD from b WHERE A.AA=B.CC);

解决方案 »

  1.   

    如果aa,cc分别为a,b表的主键的话,
    update a set a.bb = (select b.dd from b where b.cc=a.aa)
      

  2.   

    update B set B.DD=(select a.bb from a where a.aa=b.cc)但这样做的唯一错吾就是当返回的是多记录时, 就会出错!
      

  3.   

    sorry ,主键不会出错的update A set A.BB=(select B.DD from B where A.AA=B.CC)
      

  4.   

    update b set b.dd=(select a.bb from a where a.aa=b.cc)
      

  5.   

    jlandzpa(jlandzpa) 
     snowy_howe(天下有雪) 
    你这样是把所有的A。BB都更新为相同的值了
    beckhambobo(beckham)
    我正想突破这种限制
      

  6.   

    update A set BB = ( select DD from B where B.CC= A.AA ) 
    where AA in ( select CC from B )