> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# array_avg

> Returns the average of all elements in an ARRAY, ignoring NULL values.

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

## Syntax

```Haskell theme={null}
array_avg(array(type))
```

`array(type)` supports the following types of elements: BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, LARGEINT, FLOAT, DOUBLE, DECIMALV2.

## Examples

```plain text theme={null}
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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.