Where a Key value exists in several rows, a second key must be used to avoid accidental deletions.

Example

Compare Table A and B using ID as unique key.

Table A:

ID Name
1 house

Table B:

ID Name
1 house
1 car
COMPARE A to B using KEY ID

Results

  • Rows with Name “house” are matched.

  • Rows with Name “car” are not matched and flagged for deletion.

Solution

In this case, the appropriate key is (id, name).

See Also