Why does NULL = NULL evaluate to false in SQL server

前端 未结 19 1564
一向
一向 2020-11-22 05:02

In SQL server if you have nullParam=NULL in a where clause, it always evaluates to false. This is counterintuitive and has caused me many errors. I do understa

19条回答
  •  孤独总比滥情好
    2020-11-22 05:34

    How old is Frank? I don't know (null).

    How old is Shirley? I don't know (null).

    Are Frank and Shirley the same age?

    Correct answer should be "I don't know" (null), not "no", as Frank and Shirley might be the same age, we simply don't know.

提交回复
热议问题