gpt4 book ai didi

sql-server - `SET ANSI_NULLS OFF` 有什么作用?

转载 作者:行者123 更新时间:2023-12-02 10:36:24 32 4
gpt4 key购买 nike

SET ANSI_NULLS OFF 的作用是什么?

最佳答案

From MSDN:

The SQL-92 standard requires that an equals (=) or not equal to (<>) comparison against a null value evaluates to FALSE.

When SET ANSI_NULLS is ON, a SELECT statement using WHERE column_name = NULL returns zero rows even if there are null values in column_name. A SELECT statement using WHERE column_name <> NULL returns zero rows even if there are non-null values in column_name.

When SET ANSI_NULLS is OFF, the Equals (=) and Not Equal To (<>) comparison operators do not follow the SQL-92 standard. A SELECT statement using WHERE column_name = NULL returns the rows with null values in column_name. A SELECT statement using WHERE column_name <> NULL returns the rows with non-null values in the column. In addition, a SELECT statement using WHERE column_name <> XYZ_value returns all rows that are not XYZ_value and that are not NULL.

关于sql-server - `SET ANSI_NULLS OFF` 有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/411864/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com