Not equal <> != operator on NULL

后端 未结 11 1526
南旧
南旧 2020-11-22 02:50

Could someone please explain the following behavior in SQL?

SELECT * FROM MyTable WHERE MyColumn != NULL (0 Results)
SELECT * FROM MyTable WHERE MyColumn <         


        
11条回答
  •  你的背包
    2020-11-22 03:35

    NULL is not anything...it is unknown. NULL does not equal anything. That is why you have to use the magic phrase IS NULL instead of = NULL in your SQL queries

    You can refer this: http://weblogs.sqlteam.com/markc/archive/2009/06/08/60929.aspx

提交回复
热议问题