This is the nature of the outer join (in this case, the left join). The left join takes your main table (Customers), matches it according to the criteria for the combined table (Orders). For each row in the Clients that does not have a match, unlike an internal join, it does not delete the row. Instead, it adds all the fields from Orders, but puts zero in them.
Take a look at this example:
Table a table b
ββββββββ¬ββββββ βββββββββ¬βββββββ
βfield1βfield2β βfield3βfield4β
ββββββββΌββββββ β€ββββββββΌβββββββ€
βA β1 β β1 βOne β
βB β2 β β3 βThree β
βC β3 β ββββββββ΄ββββββββ
ββββββββ΄βββββββ
Internal join of tables (between field 2 and field 3):
ββββββββ¬ββββββββββββββββββββββ
βfield1βfield2βfield3βfield4β
ββββββββΌββββββββββββββββββββββ€
βA β1 β1 βOne β
βC β3 β3 βThree β
ββββββββ΄ββββββββββββββββββββββ
But the outer join of the tables should give you every record, and if there is no match, put zeros instead.
ββββββββ¬ββββββββββββββββββββββ
βfield1βfield2βfield3βfield4β
ββββββββΌββββββββββββββββββββββ€
βA β1 β1 βOne β
βB β2 βNULL βNULL ββ¬
οΈ No match
βC β3 β3 βThree β
ββββββββ΄ββββββββββββββββββββββ
Now, what happens if there are no matches in table 2? For example, if you added an impossible condition to an ON clause? Then all records as a result will look like "No match"
ββββββββ¬ββββββββββββββββββββββ
βfield1βfield2βfield3βfield4β
ββββββββΌββββββββββββββββββββββ€
βA β1 βNULL βNULL ββ¬
οΈ No match (because of impossible condition)
βB β2 βNULL βNULL ββ¬
οΈ No match (because of impossible condition)
βC β3 βNULL βNULL ββ¬
οΈ No match (because of impossible condition)
ββββββββ΄ββββββββββββββββββββββ
So it doesnβt matter if there were any matches, because in Table 2 there was no record with this ID, or if there was no match, because you added an impossible condition. The result of the outer join is that the fields that were supposed to appear from Table 2 will be replaced with zeros. Because it is the definition of external connection.
Now in the tables of the real world:
You actually have no entries in the Order whose OrderID is NULL (unless you designed it very badly). Therefore, if you put this condition in the ON clause, it will not find records matching your criteria.
In this case, since this is an external (left) connection, you get all the records of the original Clients, and since there were no matches, each of them has fields from Orders all null.
In the case where you put a condition in WHERE , you really made good use of this left join behavior. You matched each customer with his order. If there was a match - fine, you received the actual order ID. But in cases there was no match - the ones you are looking for - it adds a zero order identifier.
Then the where clause tells you that it only gives you records of where this happened. That is, entries that do not have an appropriate order in the Order.