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
ParameterTypeRequiredDescription
arrayARRAY<T>YesThe 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
Last update at: 2026/03/03 16:47:38
Last updated: 2026-03-03 16:48:19