mean

The mean: Float64 for Int64 and Float64, Decimal128(38, max(s, 6)) for decimals.

AggregateDeterministic

Flags

Flag Value
Kind aggregate
Nulls nulls are skipped
Deterministic yes
Order matters no
Decomposable yes, by sum and count

Example

A pipeline from the language's tested corpus that uses mean, over the example tables.

Hint
from orders
aggregate {n = count_all(), rows = count_all(), total = sum(amount), avg = mean(amount)}

In a plan:

JSON
{
  "args": [
    {
      "col": 2
    }
  ],
  "fn": "mean"
}