Oracle update時做表關聯

2021-09-02 12:23:20 字數 462 閱讀 6543

感覺還是sqlserver中的寫法比較好理解,oracle的寫法都快把我搞暈了,

注意:1.要修改的表,不要加入到子查詢中,用別名在子查詢中與其他表進行關聯即可。

2.exsits不能少,exsits後面的子查詢與上乙個子查詢裡的內容相同即可。

update  table1 t1 

set t1.name=

( select t2.name from table2 t2,table3 t3

where t2.id=t1.id2 and t3.id=t1.id3 and t2.is_del<>1

)where exists

( select 1 from table2 t2,table3 t3

where t2.id=t1.id2 and t3.id=t1.id3 and t2.is_del<>1

)

利用Data Pump做表空間傳輸時的幾個問題

source os redhat linux as4 x86 64 source db 10gr2 10.2.0.1 target os redhat linux as3 ia64 target db 10gr2 10.2.0.4 遇到兩個問題。1 剛開始一直提示找不到目錄,我parfile檔案裡寫...

oracle update多表關聯

update a.a3 a.a3 b.b3 的問題 表a 結構 a1 a2 a3 表b 結構 b1,b2,b3 其中 a1 b1 為pk 切值相同 就是可以使用a1 b1 了.請問用sql 語句或過程該如何實現如下的功能?更新a 表的 a3 用a.a3 與b.b3之和更新.3 update a se...

oracle update太慢優化

tb e zw nrllb temp 量700225 gsm user 量109398337 優化前 兩種update 說明 gsm user是檢視存在gsm user id索引,tb e zw nrllb temp有user id索引,使用以下兩種方法都更新時間超5h 導致不能更新成功 1upda...