日期:2014-05-16 浏览次数:20454 次
?
ORACLE:可以用MERGE语句(oracle 10g或以上),它是update和insert的组合.
?
MERGE INTO TABLE1 A
USING TABLE2 B
ON (A.OBJECT_ID = B.OBJECT_ID)
WHEN MATCHED THEN
UPDATE SET A.STATUS = B.STATUS
WHEN NOT MATCHED THEN
INSERT (OBJECT_ID, STATUS) VALUES (B.OBJECT_ID, B.STATUS)
?