Oracle Upsert新增或更新
--upsert on 可以多个条件 不能更新on的列(name,age) MERGE INTO TBL_TEST t USING (SELECT 12 AS name ,44 AS pid,22 AS age FROM DUAL) bb ON (t.name = bb.name AND t.age=bb.age) WHEN MATCHED THEN UPDATE SET t.pid=bb.pid WHEN NOT MATCHED THEN INSERT (NAME, PID,AGE) VALUES(12, 44,2);