Why NOT IN (NULL) Always returns nothing

前端 未结 3 2026
不知归路
不知归路 2021-01-24 12:33

I have following table:

And following simple query:

SELECT * FROM dbo.Calendars WHERE calname NOT IN(NULL)

My question is why always <

3条回答
  •  暖寄归人
    2021-01-24 13:31

    Your query evaluates to calname <> null , which results in UNKNOWN.

    Change your query to this ,

    SELECT * FROM dbo.Calendars WHERE calname IS NOT NULL;
    

提交回复
热议问题