DDSQL Aggregation Functions

Join the Beta!

DDSQL is in private beta.

Request Access

Aggregation functions

Aggregate functions compute a single result from a set of input values, usually used in conjunction with a GROUP BY statement.

avg

NameReturn typeDescription
avg(numeric n1, n2 …)numericComputes the average (arithmetic mean) of all the non-null input values.

max

NameReturn typeDescription
max(expr e)variableComputes the maximum of the non-null input values. Types of input values must be comparable.

min

NameReturn typeDescription
min(expr e)variableComputes the minimum of the non-null input values. Types of input values must be comparable.

sum

NameReturn typeDescription
sum(numeric n1, n2 …)numericComputes the sum of the non-null input values.

count

NameReturn typeDescription
count(expr e)integerComputes the number of input rows in which the input value is not null.
count(distinct expr e1, e2 …)integerComputes the number of input values in which the input value is not null.
count(*)integerComputes the number of input rows.