ISNULL and COALESCE though equivalent, can behave differently. An expression involving ISNULL with non-null parameters is considered to be NOT NULL, while expressions involving COALESCE with non-null parameters is considered to be NULL.
最佳答案
它确定使用 ISNULL 或 COALESCE 的计算列的可为空性
RowCheckSum AS COALESCE(...)
...意味着 RowCheckSum
列定义具有 NULL
关键字,并且
RowCheckSum2 AS ISNULL(...)
...具有 NOT NULL
定义。
这也意味着,在结果集中,第一个字段可以返回 NULL
值,而第二个字段则不能。
关于sql-server - T-SQL : What does this passage in the COALESCE documentation mean?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4524126/