After reading it, this is not a duplicate of Explicit vs Implicit SQL Joins. The answer may be related (or even the same) but the question is different.
What is the difference and what should go in each?
If I understand the theory correctly, the query optimizer should be able to use both interchangeably.
Matters for outer joins
a.
WHERE
clause: After joining. Records will be filtered after join has taken place.b.
ON
clause - Before joining. Records (from right table) will be filtered before joining. This may end up as null in the result (since OUTER join).Example: Consider the below tables:
a) Inside
WHERE
clause:b) Inside
JOIN
clauseIn terms of the optimizer, it shouldn't make a difference whether you define your join clauses with ON or WHERE.
However, IMHO, I think it's much clearer to use the ON clause when performing joins. That way you have a specific section of you query that dictates how the join is handled versus intermixed with the rest of the WHERE clauses.