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/sql-query-aggregates.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ description: Learn about SQL aggregate function syntax, types of aggregate funct
4
4
author: timsander1
5
5
ms.service: cosmos-db
6
6
ms.topic: conceptual
7
-
ms.date: 03/05/2020
7
+
ms.date: 03/16/2020
8
8
ms.author: tisande
9
9
10
10
---
11
11
# Aggregate functions in Azure Cosmos DB
12
12
13
-
Aggregate functions perform a calculation on a set of values in the SELECT clause and return a single value. For example, the following query returns the count of items within the `Families` container:
13
+
Aggregate functions perform a calculation on a set of values in the `SELECT` clause and return a single value. For example, the following query returns the count of items within the `Families` container:
14
14
15
15
## Examples
16
16
@@ -56,7 +56,7 @@ The results are:
56
56
57
57
## Types of aggregate functions
58
58
59
-
The SQL API supports the following aggregate functions. SUM and AVG operate on numeric values, and COUNT, MIN, and MAX work on numbers, strings, Booleans, and nulls.
59
+
The SQL API supports the following aggregate functions. `SUM` and `AVG` operate on numeric values, and `COUNT`, `MIN`, and `MAX` work on numbers, strings, Booleans, and nulls.
60
60
61
61
| Function | Description |
62
62
|-------|-------------|
@@ -71,6 +71,10 @@ You can also aggregate over the results of an array iteration.
71
71
> [!NOTE]
72
72
> In the Azure portal's Data Explorer, aggregation queries may aggregate partial results over only one query page. The SDK produces a single cumulative value across all pages. To perform aggregation queries using code, you need .NET SDK 1.12.0, .NET Core SDK 1.1.0, or Java SDK 1.9.5 or above.
73
73
74
+
## Remarks
75
+
76
+
These aggregate system functions will benefit from a [range index](index-policy.md#includeexclude-strategy). If you expect to do a `COUNT`, `SUM`, `MIN`, `MAX`, or `AVG` on a property, you should [include the relevant path in the indexing policy](index-policy.md#includeexclude-strategy).
77
+
74
78
## Next steps
75
79
76
80
-[Introduction to Azure Cosmos DB](introduction.md)
0 commit comments