All Products
Search
Document Center

Tablestore:Aggregate functions

Last Updated:Aug 01, 2024

An aggregate function performs a calculation on specific field values in a set of rows and returns a single value, such as the sum, average value, maximum value, or minimum value. You can execute SQL statements to analyze data in tables by using aggregate functions. This topic describes aggregate functions that are supported when you use SQL queries.

Function

Description

COUNT()

Returns the number of rows that match the specified condition.

COUNT(DISTINCT)

Returns the number of rows with different values in the specified column.

SUM()

Returns the sum of numeric columns.

AVG()

Returns the average value of numeric columns.

MAX()

Returns the maximum value in a column.

MIN()

Returns the minimum value in a column.