Skip to content

Commit df7f88d

Browse files
authored
Merge pull request #287 from NReilingh/patch-2
corrects inaccuracies in truth tables for AND/OR
2 parents 946be8b + 21f66f5 commit df7f88d

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

docs/t-sql/language-elements/null-and-unknown-transact-sql.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,23 @@ ms.workload: "On Demand"
3636

3737
- Null values cannot be used as information that is required to distinguish one row in a table from another row in a table, such as primary keys, or for information used to distribute rows, such as distribution keys.
3838

39-
When null values are present in data, logical and comparison operators can potentially return a third result of UNKNOWN instead of just TRUE or FALSE. This need for three-valued logic is a source of many application errors. These tables outline the effect of introducing null comparisons.
39+
When null values are present in data, logical and comparison operators can potentially return a third result of UNKNOWN instead of just TRUE or FALSE. This need for three-valued logic is a source of many application errors. Logical operators in a boolean expression that includes UNKNOWNs will return UNKNOWN unless the result of the operator does not depend on the UNKNOWN expression. These tables provide examples of this behavior.
4040

41-
The following table shows the results of applying an AND operator to two Boolean operands where one operand returns NULL.
41+
The following table shows the results of applying an AND operator to two Boolean expressions where one expression returns UNKNOWN.
4242

43-
|Operand 1|Operand 2|Result|
43+
|Expression 1|Expression 2|Result|
4444
|---------------|---------------|------------|
45-
|TRUE|NULL|FALSE|
46-
|NULL|NULL|FALSE|
47-
|FALSE|NULL|FALSE|
45+
|TRUE|UNKNOWN|UNKNOWN|
46+
|UNKNOWN|UNKNOWN|UNKNOWN|
47+
|FALSE|UNKNOWN|FALSE|
4848

49-
The following table shows the results of applying an OR operator to two Boolean operands where one operand returns NULL.
49+
The following table shows the results of applying an OR operator to two Boolean expressions where one expression returns UNKNOWN.
5050

51-
|Operand 1|Operand 2|Result|
51+
|Expression 1|Expression 2|Result|
5252
|---------------|---------------|------------|
53-
|TRUE|NULL|TRUE|
54-
|NULL|NULL|UNKNOWN|
55-
|FALSE|NULL|UNKNOWN|
53+
|TRUE|UNKNOWN|TRUE|
54+
|UNKNOWN|UNKNOWN|UNKNOWN|
55+
|FALSE|UNKNOWN|UNKNOWN|
5656

5757
## See Also
5858
[AND (Transact-SQL)](../../t-sql/language-elements/and-transact-sql.md)

0 commit comments

Comments
 (0)