Subject | filter conditions: WHERE vs. JOIN clause |
---|---|
Author | |
Post date | 2014-05-27T15:17:28Z |
In general, does it make a difference whether the filter conditions are in the JOIN or WHERE clause?
In practice, I've always placed the filter conditions in the WHERE clause and just used the ON portion of the JOIN clause to join the tables.
We have some new members of our team with a MS SQL background, and they have a preference for including filter conditions in the JOIN clause. They say, "the predicates in the ON clause are applied to the table before the join,
whereas the WHERE clause is semantically applied to the result of the join" and "It has to do with the record set that is available when the WHERE clause
executes. When you move more conditions into the ON clause, you have less
records (potentially) when the WHERE clause executes" Is that true?
Thank you.