Aggregate Functions

Aggregate functions are performed on several rows instead of single one.

Function and Description
avg(value: integer): float
avg(value: float): float
avg(value: numeric): numeric

Computes the average (arithmetic mean) of all the non-null input values.
count(value: any): integer
count(*): integer

Computes the number of input not null values.
first_value(value: any): any
Returns value evaluated at the row that is the first row of the window frame.
last_value(value: any): any
Returns value evaluated at the row that is the last row of the window frame.
max(value: integer): integer
max(value: float): float
max(value: numeric): numeric

Computes the maximum of the non-null input values.
min(value: integer): integer
min(value: float): float
min(value: numeric): numeric

Computes the minimum of the non-null input values.
row_number(): integer

Returns the number of the current row within its partition, counting from 1.
string_agg(target: string, delimiter: string): string

Concatenates the non-null input values into a string.
sum(value: integer): integer
sum(value: float): float
sum(value: numeric): numeric

Computes the sum of the non-null input values.