NULL is a special value in RDBMS that means an unknown or inapplicable value.
So nothing will ever be = NULL
; such comparison is not valid, thus any queries with expr = NULL
in their WHERE
clause will return no rows.
Of course this has its quirks and some implementations do things differently; eg: Oracle treats empty strings (''
) as NULL
and gets quite a bit grief for that.
SQL Server has the ANSI NULL parameter that makes it compliant with SQL-92 (eg comparisons with NULL
s like you did won't work.