日期:2014-05-17  浏览次数:20874 次

批量更新数据方法
A表和B表:
假设 A表和B表 都有 id 和 number 这两个字段,A表和B表可以通过id字段关联,现在想用B表中的number字段替换到A表的number字段,因为有几万条数据,所以想写个存储过程处理,但是小菜鸟不会写,请各位帮助下,感谢~

------解决方案--------------------
SQL code

update a a set num=(
select b.num from b b where a.id=b.id
)