|
To add to what Dimitri said: there is a semantic difference between ON and WHERE, they generate different results on outer joins. For the specific example that you posted, it does not matter what you write, the semantics are the same and the queries are simple enough to have us generate the exact same internal code. But once the queries start growing, and, god forbid, some joins stop being inner / cross and start becoming outer, putting the condition into WHERE will just return different results than if you put it into ON - you should use either ON or WHERE depending on when specifically you want the filtering to happen.
|