需要一点帮助,我的SQL几乎不存在...
NOT MATCHED BY SOURCE与NOT MATCHED BY TARGET什么区别
例如:
WHEN NOT MATCHED BY SOURCE是否意味着记录存在于目标中而不是来源? - 所以我们可以删除它们?
和WHEN NOT MATCHED BY TARGET - 是指记录存在于源中,但不存在于目标中? 所以我们可以插入它们?
Need a little help please, my SQL is almost non existent...
What is the difference between NOT MATCHED BY SOURCE vs NOT MATCHED BY TARGET
For example:
Does WHEN NOT MATCHED BY SOURCE mean that the records exist in the target by not in the source? - so we can delete them ?
and WHEN NOT MATCHED BY TARGET - mean the records exists in the source but not in the target? so we can insert them?
最满意答案
未按目标匹配时 - 应使用此子句将新行插入到目标表中。 您插入表中的行是源表中的行中目标中没有匹配行的那些行。
未按源匹配时 - 如果要从目标表中删除与源表中的行不匹配的行
WHEN NOT MATCHED BY TARGET - You should use this clause to insert new rows into the target table. The rows you insert into the table are those rows in the source table for which there are no matching rows in the target.
WHEN NOT MATCHED BY SOURCE - If you want to delete a row from the target table that does not match a row in the source table
更多推荐
发布评论