This section describes the general actions performed by a MERGE statement:
The Venn diagram below divides the source table rows into two disjunct sets: set A and set B. Set A is the set of matching rows and set B is the set of nonmatching rows.
This description uses the following terms:
The set of matching rows, A, defines the update or delete source, or staging, table.
The set of nonmatching rows, B, defines the insert source, or staging, table.
Either set can be empty, but both cannot be empty for a MERGE operation.
The system uses the set of matching rows as the update or delete source table for the update operation, as specified by the update_column=update_expression variable.
The system uses the set of nonmatching rows as the insert source table for the insert operation, as specified by the insert_expression variable.