How does comparison operator works with null int?

前端 未结 4 525
半阙折子戏
半阙折子戏 2020-11-27 04:48

I am starting to learn nullable types and ran into following behavior.

While trying nullable int, i see comparison operator gives me unexpected result. For example,

4条回答
  •  遥遥无期
    2020-11-27 05:17

    Comparing C# with SQL

    C#: a=null and b=null => a==b => true

    SQL: a=null and b=null => a==b => false

提交回复
热议问题