cancel
Showing results for 
Search instead for 
Did you mean: 

merge, when not matched by source, delete with restrictions

Johan_Hakkesteegt
Active Contributor
0 Kudos
384

Hi,

I have a table containing order rows. The table is populated from two different sources, and has a field that determines from which source the data came.

With one of the sources I use MERGE. Now I would like to use WHEN NOT MATCHED BY SOURCE THEN DELETE, but if I understand it correctly, this would also delete all records from the other source, as they would not definitely not match.

Is it possible, and if yes then how, to delete only records with the relevant DataSource, using this method?

Regards,

Johan

Accepted Solutions (1)

Accepted Solutions (1)

Johan_Hakkesteegt
Active Contributor
0 Kudos

Never mind, I realized I achieve this with the ON clause.

Answers (0)