加入多个条件 [英] join on multiple conditions
问题描述
我想加入不同条件的数据。例如,我有两个名为"t"的表。和"y"。我想在ssis上加入:
I want to join data on different conditions. for example I have two tables named "t" and "y". I want to do this join on ssis:
" select * from t left join y on(t.tel = y.tel或t.tel = y.mobile)and(t .mobile = y.tel或t.mobile = y.mobile )"
"select * from t left join y on (t.tel = y.tel or t.tel = y.mobile) and (t.mobile = y.tel or t.mobile = y.mobile)"
如何在ssis中加入?
推荐答案
嗨
Hi
在SSIS中,您可以使用合并加入来执行此操作。 SSIS基础:使用合并连接转换
In SSIS, you can do this with Merge Join. SSIS Basics: Using the Merge Join Transformation
要连接多个列,您需要在两个输入中对这些列进行排序。
To join on multiple columns, you need to sort these columns fist, in both of the Input.
并在合并连接中映射这些列。
And map these columns in Merge join.
参见;
这篇关于加入多个条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!