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
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
本文标题:Oracle 两表关联更新
本文链接:https://www.haomeiwen.com/subject/qsqlgqtx.html
网友评论