日期:2014-05-18  浏览次数:20515 次

数据替换问题
有两个表   A表和B表   以id   关联   现在将A表里的字段a01   用B表的字段b01来更新  
怎么写语句

------解决方案--------------------
update a
set a.a01=b.b01
from a,b
where a.id=b.id
------解决方案--------------------
update a set a01=b.b01 from b where a.id=b.id
------解决方案--------------------
update a
set a.a01=b.b01
from a
left join b
on a.id=b.id

------解决方案--------------------
update b set b.b01=a.a01 from a,b
where a.id=b.id