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
相關文章
相關標籤/搜索