Oracle用其中一个表的数据更新另外一个表

update tab1 set val = (select val from tab2 where tab1.id = tab2.id) where exists (select 1 from tab2 where tab1.id = tab2.id) 这样tab2中没有的部分就不会被更新到tab1,但若是tab2中没值的部分,tab1中就应该为空,那就把最后一句去掉,改为spa update t
相关文章
相关标签/搜索