db2 equivalent of MySql REPLACE INTO
问题 I very useful statement I like of MySql is REPLACE INTO table that is 'REPLACE a value if-exist OR INSERT INTO table If-Not-Exist'. The documentation of db2 REPLACE is for a function operating on strings only so not with that meaning. Is there any equivalent in db2? Right now I am looking also for keywords IF EXSTS/IF NOT EXIST . 回答1: DB2 uses the SQL standard MERGE statement to do basically the same thing. The syntax is different: MERGE INTO table_to_upsert AS tab USING (VALUES (1, 2, 3), (4