After a LEFT JOIN, filtering where the right-side key is NULL keeps only the left rows that found no match.

highlighted = computed this step

Orders input

Start with orders, including one missing customer key and one NULL key.

Orders\text{Orders}
Ordersorder_idcustomer_idamounto1c1120o2c280o3c_missing50o4NULL40

Customers input

Customers only has the keys that can match.

Customers\text{Customers}
Customerscustomer_idsegmentc1retailc2wholesale

Join query

LEFT JOIN first, then keep rows where the right customer key is NULL.

LEFT JOIN then WHERE right key IS NULL\text{LEFT JOIN then WHERE right key IS NULL}
LEFT JOIN then keep unmatched orderswhere is_nullarity 5 rows 2left join customer_id=customer_idarity 5 rows 4Ordersarity 3 rows 4Customersarity 2 rows 2

Joined output

Only the unmatched left rows remain, with NULL right-side cells.

unmatched left rows\text{unmatched left rows}
Joined outputorder_idcustomer_idamountCustomers.customer_idsegmento3c_missing50NULLNULLo4NULL40NULLNULL