Calculate the average from a one-dimensional statistical aggregate
Since 1.3.0
Calculate a simple average (or mean) from the values in a statistical aggregate.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Calculate the average from a one-dimensional statistical aggregate
SELECT average(stats_agg(data))
FROM generate_series(0, 100) data;
average
-----------
50
average(
summary StatsSummary1D
) RETURNS DOUBLE PRECISION
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| summary | StatsSummary1D | - | ✔ | The statistical aggregate produced by a stats_agg call |
| Column | Type | Description |
|---|---|---|
| average | DOUBLE PRECISION | The average of the values in the statistical aggregate |