4 ms·
For example, if it were the case that NULL = NULL, really counterintuitive stuff would happen on joins because a null cell would match with every other null ce
by smadge 8y ago
For example, if it were the case that NULL = NULL, really counterintuitive stuff would happen on joins because a null cell would match with every other null cell you are joining on:
person
name home_address
---------------------------
"Alice" NULL
"Bob" "123 Jump Street"
letter
return_address description
----------------------------------
NULL "Ransom Letter"
NULL "Spy Document"
"123 Jump Street" "Hello, from Bob"
Then
SELECT name, description FROM person INNER JOIN letter ON home_address = return_address
would return
name description
------------
"Alice" "Ransom Letter"
"Alice" "Anonymous Spy Document"
"Bob" "Hello from Bob"
So now Alice is associated with a bunch of letters she didn't necessarily write because she doesn't have a home address.