Skip to content

Commit 6a33498

Browse files
authored
Merge pull request #108233 from timsander1/master
fix truth tables formatting
2 parents 317275f + 6f48323 commit 6a33498

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

articles/cosmos-db/sql-query-operators.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
22
title: SQL query operators for Azure Cosmos DB
33
description: Learn about SQL operators such as equality, comparison, and logical operators supported by Azure Cosmos DB.
4-
author: markjbrown
4+
author: timsander1
55
ms.service: cosmos-db
66
ms.topic: conceptual
7-
ms.date: 12/02/2019
8-
ms.author: mjbrown
7+
ms.date: 03/19/2020
8+
ms.author: tisande
99

1010
---
1111
# Operators in Azure Cosmos DB
@@ -36,36 +36,51 @@ Logical operators operate on Boolean values. The following tables show the logic
3636

3737
**OR operator**
3838

39-
| OR | True | False | Undefined |
39+
Returns `true` when either of the conditions is `true`.
40+
41+
| | **True** | **False** | **Undefined** |
4042
| --- | --- | --- | --- |
41-
| True |True |True |True |
42-
| False |True |False |Undefined |
43-
| Undefined |True |Undefined |Undefined |
43+
| **True** |True |True |True |
44+
| **False** |True |False |Undefined |
45+
| **Undefined** |True |Undefined |Undefined |
4446

4547
**AND operator**
4648

47-
| AND | True | False | Undefined |
49+
Returns `true` when both expressions are `true`.
50+
51+
| | **True** | **False** | **Undefined** |
4852
| --- | --- | --- | --- |
49-
| True |True |False |Undefined |
50-
| False |False |False |False |
51-
| Undefined |Undefined |False |Undefined |
53+
| **True** |True |False |Undefined |
54+
| **False** |False |False |False |
55+
| **Undefined** |Undefined |False |Undefined |
5256

5357
**NOT operator**
5458

55-
| NOT | |
59+
Reverses the value of any Boolean expression.
60+
61+
| | **NOT** |
5662
| --- | --- |
57-
| True |False |
58-
| False |True |
59-
| Undefined |Undefined |
63+
| **True** |False |
64+
| **False** |True |
65+
| **Undefined** |Undefined |
6066

67+
**Operator Precedence**
68+
69+
The logical operators `OR`, `AND`, and `NOT` have the precedence level shown below:
70+
71+
| **Operator** | **Priority** |
72+
| --- | --- |
73+
| **NOT** |1 |
74+
| **AND** |2 |
75+
| **OR** |3 |
6176

6277
## * operator
6378

6479
The special operator * projects the entire item as is. When used, it must be the only projected field. A query like `SELECT * FROM Families f` is valid, but `SELECT VALUE * FROM Families f` and `SELECT *, f.id FROM Families f` are not valid.
6580

6681
## ? and ?? operators
6782

68-
You can use the Ternary (?) and Coalesce (??) operators to build conditional expressions, as in programming languages like C# and JavaScript.
83+
You can use the Ternary (?) and Coalesce (??) operators to build conditional expressions, as in programming languages like C# and JavaScript.
6984

7085
You can use the ? operator to construct new JSON properties on the fly. For example, the following query classifies grade levels into `elementary` or `other`:
7186

0 commit comments

Comments
 (0)