Oracle 两表关联更新

2019-04-20  本文已影响0人  iAPTX4869

Oracle 两表关联更新

UPDATE T2
   SET T2.C =
       (SELECT B FROM T1 WHERE T1.A = T2.A)
 WHERE EXISTS (SELECT 1 FROM T1 WHERE T1.A = T2.A)
MERGE INTO T2
USING T1
ON (T2.A = T1.A)
WHEN MATCHED THEN
  UPDATE SET T2.C = T1.B
上一篇下一篇

猜你喜欢

热点阅读