Edit

array_avg

Description

Calculates the average value of all data in an ARRAY and return this result.

Syntax

array_avg(array(type))

Examples

mysql> select array_avg([11, 11, 12]);
+-----------------------+
| array_avg([11,11,12]) |
+-----------------------+
| 11.333333333333334    |
+-----------------------+

mysql> select array_avg([11.33, 11.11, 12.324]);
+---------------------------------+
| array_avg([11.33,11.11,12.324]) |
+---------------------------------+
| 11.588                          |
+---------------------------------+

keyword

ARRAY_AVG,ARRAY