Aggregate Function

An aggregate function performs a calculation operation on a set of input values and returns a value. For example, the COUNT function counts the number of rows retrieved by an SQL statement. Table 1 lists aggregate functions.

Table 1 Aggregate functions

Function

Return Data Type

Description

COUNT(value [, value]* )

DOUBLE

Return count of values that are not null.

COUNT(*)

BIGINT

Return count of tuples.

AVG(numeric)

DOUBLE

Return average (arithmetic mean) of all input values.

SUM(numeric)

DOUBLE

Return the sum of all input numerical values.

MAX(value)

DOUBLE

Return the maximum value of all input values.

MIN(value)

DOUBLE

Return the minimum value of all input values.

STDDEV_POP(value)

DOUBLE

Return the population standard deviation of all numeric fields of all input values.

STDDEV_SAMP(value)

DOUBLE

Return the sample standard deviation of all numeric fields of all input values.

VAR_POP(value)

DOUBLE

Return the population variance (square of population standard deviation) of numeral fields of all input values.

VAR_SAMP(value)

DOUBLE

Return the sample variance (square of the sample standard deviation) of numeric fields of all input values.

Precautions

None

Example

None