select e.last_name, e.hire_date
from employees e join employees m
on (m.last_name = \'Davies\')
and (e.hire_date > m.hire_date);
select e.last_name, e.hire_date
where
is a filter which is applied after rows are selected using the join. It is not always the case that a join ... on
condition is sematically equivalent to a where
condition. Therefore, yes, there is a particular reason to use a where
in table joins: when it does the right thing.
...and by contrast, the
ON
condition executes as the join is being made.ON
conditions for joins earlier in multi-table joins can cut off millions of unnecessary joins so are generally preferred if semantically correct
– Bohemian