I need to get data from a join between two tables, but I just want the data that exists in first table and not in second one. It's like:
SELECT t1.*
FROM t1
LEFT JOIN t2 ON t1.col1 = t2.col1
WHERE t2.col1 IS NULL
I'm using the merge join transformation, but I can't find no options to put the WHERE code in the join. How can I do that? Anyone can help me?
Cheers!Just use the Left Outer Join option under Join Type. That will output all rows from the left input, with any matching rows from the right input. The where clause is not necessary.|||
jwelch wrote:
Just use the Left Outer Join option under Join Type. That will output all rows from the left input, with any matching rows from the right input. The where clause is not necessary.
And then add a conditional split to kick out the rows that are not null from the second source (the right side of the merge join) so as to get a resultset of rows from the left that don't exist in the right.
John's approach is just part of the answer if you want to show only records that don't exist in the right side.|||Phil is correct. Too much caffeine today, or not enough, I don't know which |||
I can't believe I can't see it. Man, you're good. Thanks a lot!
Phil Brammer wrote:
And then add a conditional split to kick out the rows that are not null from the second source (the right side of the merge join) so as to get a resultset of rows from the left that don't exist in the right.
John's approach is just part of the answer if you want to show only records that don't exist in the right side.
No comments:
Post a Comment