You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/nosql/query/keywords.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ The results are:
98
98
]
99
99
```
100
100
101
-
Queries with an aggregate system function and a subquery with `DISTINCT` are only supported in specific SDK versions. For example, queries with the following shape are only supported in the below specific SDK versions:
101
+
Queries with an aggregate system function and a subquery with `DISTINCT` are only supported in specific SDK versions. This is because they require coordination of the results returned from every continuation to create an exact result set. For example, queries with the following shape are only supported in the below specific SDK versions:
102
102
103
103
```sql
104
104
SELECTCOUNT(1) FROM (SELECT DISTINCTf.lastNameFROM f)
@@ -113,11 +113,11 @@ SELECT COUNT(1) FROM (SELECT DISTINCT f.lastName FROM f)
113
113
|Node.js SDK|Unsupported|
114
114
|Python SDK|Unsupported|
115
115
116
-
There are some additional restrictions on queries with a subquery with `DISTINCT`. The below queries are unsupported:
116
+
There are some additional restrictions on nested queries with `DISTINCT` regardless of SDK version. In these cases, there may be incorrect and inconsistent results because the query would require extra coordination. The below queries are unsupported:
117
117
118
118
|**Restriction**|**Example**|
119
119
|-------|----------------------|
120
-
|Subquery|SELECT VALUE f FROM (SELECT DISTINCT c.year FROM c) f|
120
+
|Nested Subquery|SELECT VALUE f FROM (SELECT DISTINCT c.year FROM c) f|
121
121
|WHERE clause in the outer query|SELECT COUNT(1) FROM (SELECT DISTINCT VALUE c.lastName FROM c) AS lastName WHERE lastName = "Smith"|
122
122
|ORDER BY clause in the outer query|SELECT VALUE COUNT(1) FROM (SELECT DISTINCT VALUE c.lastName FROM c) AS lastName ORDER BY lastName|
123
123
|GROUP BY clause in the outer query|SELECT COUNT(1) as annualCount, d.year FROM (SELECT DISTINCT c.year, c.id FROM c) AS d GROUP BY d.year|
0 commit comments