ARRAY_AVG
All functions > ARRAY > ARRAY_AVG
Returns the arithmetic mean (average) of all numeric elements in an array.
Signatures
Returns: The arithmetic mean as a DOUBLE value
ARRAY_AVG(array: ARRAY<T>) → DOUBLE sql
| Parameter | Type | Required | Description |
|---|---|---|---|
array | ARRAY<T> | Yes | The numeric array to calculate the average of |
Notes
- Calculates sum divided by count of non-NULL values
- Ignores NULL values in the calculation
- Always returns DOUBLE regardless of input type
- Returns NULL for empty arrays or arrays with only NULL values
- Uses floating-point arithmetic for precision
On this page