svrijssel
New Contributor II

Yep, I was thinking the same. The only way I know is to have a seperated INSERT INTO command before the MERGE INTO.

INSERT INTO target_table (
     columns,
     effectiveStartDate,
     effectiveEndDate,
     isCurrent,
     version
)
SELECT
     new.columns,
     DATE(new.timestamp),
     DATE('9999-12-31'),
     TRUE,
     target.version + 1
FROM df as new
LEFT JOIN destination_table as target
ON new.customerId = target.customerId and target.isCurrent
WHERE (
  target.column <> new.column
  OR target.column <> new.column
)