rt
a表结构 a.id 和a.aa
b表结构 b.id 和 b。bb
要把bb更行到aa列中,限制条件为a.id = b.id 

解决方案 »

  1.   

    update a set aa=bb from b where a.id=b.id
      

  2.   

    update a set aa=b.bb from a,b where a.id=b.id
      

  3.   

    update a
    set aa=bb 
    from ta a,tb b 
    where a.id=b.id
      

  4.   

    同上
    update a
    set aa=bb  
    from ta a,tb b  
    where a.id=b.id
      

  5.   

    update a set a.aa = b.bb from b where a.id = b.id
      

  6.   

    一楼的改一下也可以“:update a set aa=b.bb from b where a.id=b.id
    如果你的A表没有BB列,也是没问题的。
      

  7.   


    update a set a.aa=b.bb from a,b where a.id=b.id
    update a set a.aa=(select bb from b where a.id=b.id)
      

  8.   

    执行五六分钟了,没反应,a表大概有2w条记录,b表中只有4-5000条记录