When MERGE detects duplicate rows during an UPDATE operation, the actions Teradata Database performs depends on several factors. Duplicate row processing for UPDATE operations is the same in ANSI or Teradata session mode.
Error‑causing rows are logged in an error table and are not rolled back.
The UPDATE source relation for a MERGE statement can contain duplicate rows.
When the system updates rows in the target table, duplicate updates are processed as described in the following table:
IN this session mode … |
The system processes duplicate update attempts by … |
ANSI |
taking one of the following actions: This means that the system updates the target table row only once under these circumstances. |
Teradata |
updating the row from the duplicate set the first time and rejecting all the remaining update attempts from that set. The system updates only one row in the target table under these circumstances. This means that the system updates the target table row only once under these circumstances. |
The following rule sets apply to different aspects of the MERGE statement.