Multiple joins at once
Hi,
If I have multiple joins in the same join command, how will they be treated? Specifically, if I have an Inner Join and I'm joining a third sheet with an Outer Left Join, will the first Inner Join be the limiting factor? See http://i.imgur.com/gjWPPyU.png.
Thanks,
Andy
-
Official comment
Thanks for the question Andy! Both joins will be applied to the data set so yes, the inner join will limit results. Logically, the order of the joins does not matter -- the end result is the same in this case.
In your example, there are three data sets: Set1, Set2 and Set3. Set1 and Set2 are inner joined on an ID column. Additionally Set2 is outer left joined to Set3 by ID.
To build a full example, let's suppose this is in your data set which gives us full coverage of all possibilities of combinations of rows:
Set1 - Animals:
1, Ant
3, Cougar
5, Elephant
7, GiraffeSet2 - RadioWords:
1, Alpha
2, Bravo
3, Charlie
4, DeltaSet3 - Food:
1, Apple
2, Banana
5, Egg
6, FriesThe expected output should contain the following data after performing your join:
1, Ant, Alpha, Apple
3, Cougar, Charlie, [null]Hope this helps!
Comment actions
Please sign in to leave a comment.
Comments
2 comments