1-- Oracle: Example for Insert or update in t1 from t2 values
2MERGE INTO table1 t1
3USING table2 t2
4ON (t1.CODE = t2.ID)
5WHEN MATCHED THEN
6 UPDATE SET t1.COL1 = t2.VALUE1
7WHEN NOT MATCHED THEN
8 INSERT (CODE, COL1) VALUES (t2.ID, t2.VALUE1);
9
10-- MySql (makes a INSERT + DELETE if existing)
11REPLACE INTO table1 (pk_id, col1) VALUES (5, 'aaaa');
12--
13INSERT INTO table1 VALUES (key, generation)
14ON DUPLICATE KEY UPDATE (key = key, generation = generation + 1);