SSIS如何相交和互斥 [英] How Intersect and Except result in SSIS
问题描述
具有两个结果集A和B,在SSIS中合并连接如何获取A结果集的EXCEPT和INTERSECT.
Have Two result Set A and B, In SSIS Merge Join how get EXCEPT and INTERSECT of A result set.
所需的以下sql语法返回:
Bellow sql syntax return desired out put:
---Insersect
select a.* from A a Inner join B b on a.Key=b.Key
--Except
select a.* from A a left join B b on a.Key=b.Key where b.Key is null
如何从SSIS合并联接中获取那些查询结果
How to get those query result from SSIS merge join
推荐答案
在合并联接转换"编辑器中,可以选择Join Type
属性来执行此操作:
In the Merge Join Transformation editor, you can select the Join Type
property to do that:
除了:
从a中选择a.* a.Key = b.Key上的左连接B b,其中b.Key为空
select a.* from A a left join B b on a.Key=b.Key where b.Key is null
您必须设置Join Type
= Left Outer Join
,并且在Merge Join Transformation
之后,您必须添加条件拆分来过滤具有b.Key is null
You have to set Join Type
= Left Outer Join
, and after the Merge Join Transformation
you have to add a conditional split to filter rows that has b.Key is null
请关注此详细文章: 相交
从a a.* a.Key = b.Key上的内部连接B b中选择a.*
select a.* from A a Inner join B b on a.Key=b.Key
您必须设置Join Type
= Inner Join
为此遵循以下文章: 查看全文