Not equal <> != operator on NULL

后端 未结 11 1546
南旧
南旧 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:39

    Note that this behavior is the default (ANSI) behavior.

    If you:

     SET ANSI_NULLS OFF
    

    http://msdn.microsoft.com/en-us/library/ms188048.aspx

    You'll get different results.

    SET ANSI_NULLS OFF will apparently be going away in the future...

提交回复
热议问题