When using inner joins there is no semantic difference between the two, and it would usually be make sense to put join related conditions in the
JOIN and filtering ones in the
However, when using outer joins the semantics are not the same.
for example: in a left join - rows from the left table will be returned even if there the
JOIN ON includes some limitation on the fields from right table that are not met. but if the same limitation would be moved to the
WHERE clause - the (already Left Joined) row from the left table that has no matching row on the right table will be discarded.
INNER JOIN - it does not matter - for
OUTER JOIN - you should think what exactly do you want to get.
Note that in some cases this is actually desirable.
e.g. - In Queries such as:
FROM T1 LEFT JOIN T2 ON T2.id = T1.t2_id
WHERE T2.id IS NULL ;