Aggregation Functions

avg(expression)

Returns the average of all input values.

Parameters:expression (int | float) –
Return type:float8
corr(expression1, expression2)

Returns the coefficient of correlation between a set of number pairs.

Parameters:
  • expression1 (int | float) –
  • expression2 (int | float) –
Return type:

float8

count()

Returns the number of input rows.

Return type:int8
last_value(expression)

Returns the last value of expression.

Parameters:expression (int | float | date | time | timestamp | text) –
Return type:same as parameter data type
max(expression)

Returns the maximum value of expression.

Parameters:expression (int | float | date | time | timestamp | text) –
Return type:same as parameter data type
min(expression)

Returns the minimum value of expression.

Parameters:expression (int | float | date | time | timestamp | text) –
Return type:same as parameter data type
stddev_pop(expression)

Returns the population standard deviation of a set of numbers.

Parameters:expression (int | float) –
Return type:float8
stddev_samp(expression)

Returns the sample standard deviation of a set of numbers.

Parameters:expression (int | float) –
Return type:float8
sum(expression)

Returns the sum of a set of numbers.

Parameters:expression (int | float) –
Return type:same as parameter data type
var_pop(expression)

Returns the variance of a set of numbers.

Parameters:expression (int | float) –
Return type:float8
var_samp(expression)

Returns the unbiased sample variance of a set of numbers.

Parameters:expression (int | float) –
Return type:float8