Skip to content

Commit d97abd1

Browse files
authored
Merge pull request #105901 from timsander1/master
Aggregate of distinct note
2 parents 82908a6 + 5e68944 commit d97abd1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ In SQL API, unlike ANSI SQL, you can express range queries against properties of
3737

3838
The DISTINCT keyword eliminates duplicates in the query's projection.
3939

40+
In this example, the query projects values for each last name:
41+
4042
```sql
4143
SELECT DISTINCT VALUE f.lastName
4244
FROM Families f
4345
```
4446

45-
In this example, the query projects values for each last name.
46-
4747
The results are:
4848

4949
```json
@@ -96,6 +96,13 @@ The results are:
9696
}
9797
]
9898
```
99+
100+
Queries with an aggregate system function and a subquery with DISTINCT are not supported. For example, the following query is not supported:
101+
102+
```sql
103+
SELECT COUNT(1) FROM (SELECT DISTINCT f.lastName FROM f)
104+
```
105+
99106
## <a name="in"></a> IN
100107

101108
Use the IN keyword to check whether a specified value matches any value in a list. For example, the following query returns all family items where the `id` is `WakefieldFamily` or `AndersenFamily`.

0 commit comments

Comments
 (0)