问题
Have Two result Set A and B, In SSIS Merge Join how get EXCEPT and INTERSECT of A result set.
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
How to get those query result from SSIS merge join
回答1:
According to his Microsoft Artcile, "The Merge Join transformation provides an output that is generated by joining two sorted datasets using a FULL, LEFT, or INNER join"
In the Merge Join Transformation editor, you can select the Join Type
property to do that:
Except:
select a.* from A a left join B b on a.Key=b.Key where 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
Follow this detailed article for that: Get all from Table A that isn't in Table B
Intersect
select a.* from A a Inner join B b on a.Key=b.Key
You have to set Join Type
= Inner Join
Follow this article for that: Inner join in SSIS
来源:https://stackoverflow.com/questions/47880137/how-intersect-and-except-result-in-ssis