PostgreSQL: ON vs WHERE in outer joins - when moving a condition changes the result
In outer joins, a condition in ON is evaluated during the join while a condition in WHERE filters the already-built result, so moving a filter between them can change which rows survive. For inner joins the placement is purely stylistic.
postgresql / sql / outer-join / left-join / join-conditions