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

# array_max

> 返回ARRAY中所有元素的最大值。

求取一个ARRAY中的所有数据中的最大值，返回这个结果。

## 语法

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

## 示例

```plain text theme={null}
mysql> select array_max([113, 11, 12]);
+------------------------+
| array_max([113,11,12]) |
+------------------------+
| 113                    |
+------------------------+

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

mysql> select array_max([cast('2020-02-25 11:35:17' as datetime), cast('2019-08-25 17:07:10' as datetime), cast('2025-08-25 17:07:10' as datetime)]);
+--------------------------------------------------------------------------------------------------------------------------------------+
| array_max([CAST('2020-02-25 11:35:17' AS DATETIME),CAST('2019-08-25 17:07:10' AS DATETIME),CAST('2025-08-25 17:07:10' AS DATETIME)]) |
+--------------------------------------------------------------------------------------------------------------------------------------+
| 2025-08-25 17:07:10                                                                                                                  |
+--------------------------------------------------------------------------------------------------------------------------------------+
```


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