sql连表更新

示例

sqlserver:

update a set a.name=b.name,a.value=b.value from table1 a,table2 b where b.id='id2' and a.id=b.id

 

 Oracle:

update table1 a set name=(select name from table2 b where a.no=b.no) where 
exists(select name from table2 b where a.no=b.no); 

 

posted @ 2018-10-09 16:49  看那一叶春风  阅读(800)  评论(0编辑  收藏  举报