# Aggregate Function Reference

Aggregate functions combine several input rows into one result. See the
[overview](https://coordinatordb.com/docs/reference/functions/aggregate-functions) for NULL handling and aggregate modifiers, or follow an
individual function for its syntax, result type, and examples.

## Counting, totals, and extrema

* [`count`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/count)
* [`sum`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/sum)
* [`total`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/total)
* [`avg`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/avg)
* [`min`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/min)
* [`max`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/max)
* [`any_value`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/any-value)

## Conditional aggregates

* [`count_if`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/count-if)
* [`sum_if`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/sum-if)
* [`avg_if`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/avg-if)

## Statistics

* [`stddev_pop`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/stddev-pop)
* [`stddev_samp`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/stddev-samp)
* [`var_pop`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/var-pop)
* [`var_samp`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/var-samp)
* [`covar_pop`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/covar-pop)
* [`covar_samp`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/covar-samp)
* [`corr`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/corr)
* [`regr_avgx`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-avgx)
* [`regr_avgy`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-avgy)
* [`regr_count`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-count)
* [`regr_intercept`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-intercept)
* [`regr_r2`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-r2)
* [`regr_slope`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-slope)
* [`regr_sxx`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-sxx)
* [`regr_sxy`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-sxy)
* [`regr_syy`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/regr-syy)
* [`mode`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/mode)
* [`percentile_cont`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/percentile-cont)
* [`percentile_disc`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/percentile-disc)

## Boolean and bitwise aggregates

* [`bool_and`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/bool-and)
* [`bool_or`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/bool-or)
* [`bit_and`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/bit-and)
* [`bit_or`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/bit-or)
* [`bit_xor`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/bit-xor)

## Arrays and strings

* [`array_agg`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/array-agg)
* [`group_concat`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/group-concat)
* [`string_agg`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/group-concat)

## JSON aggregates

* [`json_agg`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/json-agg)
* [`json_agg_strict`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/json-agg-strict)
* [`json_group_array`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/json-group-array)
* [`json_group_object`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/json-group-object)
* [`json_object_agg`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/json-object-agg)
* [`json_object_agg_strict`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/json-object-agg-strict)
* [`json_object_agg_unique`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/json-object-agg-unique)
* [`json_object_agg_unique_strict`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/json-object-agg-unique-strict)
* [`jsonb_agg`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/jsonb-agg)
* [`jsonb_agg_strict`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/jsonb-agg-strict)
* [`jsonb_object_agg`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/jsonb-object-agg)
* [`jsonb_object_agg_strict`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/jsonb-object-agg-strict)
* [`jsonb_object_agg_unique`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/jsonb-object-agg-unique)
* [`jsonb_object_agg_unique_strict`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/jsonb-object-agg-unique-strict)

## Intermediate aggregate states

* [`avg_merge`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge)
* [`avg_merge_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge_state)
* [`avg_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_state)
* [`count_merge`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge)
* [`count_merge_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge_state)
* [`count_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_state)
* [`max_merge`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge)
* [`max_merge_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge_state)
* [`max_simple_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_simple_state)
* [`max_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_state)
* [`min_merge`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge)
* [`min_merge_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge_state)
* [`min_simple_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_simple_state)
* [`min_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_state)
* [`sum_merge`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge)
* [`sum_merge_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_merge_state)
* [`sum_simple_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_simple_state)
* [`sum_state`](https://coordinatordb.com/docs/reference/functions/aggregate-functions/combinators#_state)
