Nulls and the MERGE statement: I need to set a value to infinity. How?
You can change the ON part of the merge statement, putting in a check for when both source and target are null.
MERGE tgt
USING src
ON ( -- enter non-nullable columns to match on ...
tgt.A = src.A
AND (tgt.C = src.C OR (tgt.C IS NULL AND src.C IS NULL))
)
WHEN MATCHED -- ...
You can use
WHEN MATCHED AND EXISTS (SELECT tgt.C EXCEPT SELECT src.C)
See this article for more on this issue.