I want to make sure I\'m not inserting a duplicate row into my table (e.g. only primary key different). All my fields allow NULLS as I\'ve decided null to mean \"all values
NULLIF(TARGET.relation_id, SOURCE.app_relation_id) IS NULL Simple solution