Why does this query always return NULL?
SELECT (Supervisor IS NULL) = (Supervisor = NULL) FROM Salespeople
is it because we specify the second half with equal to null ?
Why does this query always return NULL?
SELECT (Supervisor IS NULL) = (Supervisor = NULL) FROM Salespeople
is it because we specify the second half with equal to null ?
Supervisor IS NULL
returns TRUE
or FALSE
.
Supervisor = NULL
always returns NULL
.
Thus, TRUE = NULL
or FALSE = NULL
will always return NULL
.
That's why your query will return NULL
rows whose count will be the total row-count of your table.