Example of MERGE INTO
This query extracts derived columns 'a' and 'b' from the USING query as derived table 'z' and
use each row to join to the merged table 't' based on the ON clause. For each matched row, column
'b' in table 't' is updated using column 'b' in derived table 'z'. For rows that are not matched,
values z.a and z.b are inserted.
MERGE INTO t USING
(SELECT * FROM t1) z(a,b) on a = z.a
WHEN MATCHED THEN UPDATE SET b = z.b
WHEN NOT MATCHED THEN INSERT VALUES (z.a, z.b);
MERGE INTO Statement
153