In my where clause,
I have the following:
where SharePt NOT LIKE 'SharePoint Document%'
The result does not return anything even though SharePt is null.
But when I do the following it works
OR SharePtVer IS NULL
where SharePt NOT LIKE 'SharePoint Document%' OR SharePt IS NULL
Wondering why NOT LIKE doesn’t work in terms of including a NULL>
SQL uses three-valued logic…
NULLis not the same asFALSE, andNOT NULLis not the same asTRUE.NULLrepresents the absence of a value, and functions an unknown value in SQL’s three valued logic:When
where SharePt NOT LIKE 'SharePoint Document%'is evaluated, ifSharePtisNULL, or unknown… then the result would be unknown…SharePtmay or may not beLIKE 'SharePoint Document%'.