Analysis of the merge statement:
/**
The merge statement is a new syntax for merging the UPDATE and INSERT statements oracle9i.
With the merge statement, another table is queried based on the join criteria of one table or subquery,
The connection condition matches the execution insert on the update that cannot be matched.
This syntax only needs a full table scan to complete the whole work, the execution efficiency is higher than insert+update.
**/
The basic framework for the merge statement:
Merge into target table T1 using (SELECT * from additional table) T2
On (T1. Field name = T2. Field name)--associated condition
When matched and then-updates are made when the associated conditions are met
Update set T1. Specify Field name = T2. Specify field name--Update table data
When is not matched and then--does not conform to the association condition, inserts
Insert (T1. Specify field name)--can be multiple, separated by commas
VALUES (T2. Specify field names)--can be multiple, separated by commas, must correspond to field one by one of T1
The Merege statement in Oracle uses