Hi,
Have gotten some good answers here. So here is a case. It is a requirements to merge data.
This involves steps:
- Compare to sets of data - say Target and Source.
- Any record not in Target but in Source will be added (insert).
- Any record in Target but not in Source will be flagged ‘deleted’ or deleted (delete)
- Any record in both sets will be updated - say a timestamp will be updated (update)
In SQL it is known as MERGE.
One way would be an full outer join and then use filters, with three branches in the plan, but I hope I miss an easier way ;)