`average(summary StatsSummary1D) RETURNS BIGINT`

Copy `average_y(summary StatsSummary2D) RETURNS BIGINT`

Copy `average_x(summary StatsSummary2D) RETURNS BIGINT`

Copy Get the average of the values contained in a statistical aggregate.
In a two-dimensional `stats_agg`

use the `_y`

/ `_x`

form to access the
average of the dependent and independent variables.

For more information about statistical aggregate functions, see the
hyperfunctions documentation .

Required arguments Name Type Description `summary`

`StatsSummary1D`

/`StatsSummary2D`

The already constructed data structure from a previous `stats_agg`

call

Returns Column Type Description `average`

/`average_y`

/`average_x`

`DOUBLE PRECISION`

The average of the values in the statistical aggregate

Sample usage ```
SELECT average(stats_agg(data))
FROM generate_series(0, 100) data;
```

Copy ```
average
-----------
50
```

Copy Found an issue on this page?

Report an issue!