メインコンテンツまでスキップ

array_min

array_min

説明

ARRAY内のすべてのデータの最小値を取得し、その結果を返します。

構文

array_min(array(type))

mysql> select array_min([113, 11, 12]);
+------------------------+
| array_min([113,11,12]) |
+------------------------+
| 11 |
+------------------------+

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

mysql> select array_min([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_min([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)]) |
+--------------------------------------------------------------------------------------------------------------------------------------+
| 2019-08-25 17:07:10 |
+--------------------------------------------------------------------------------------------------------------------------------------+

キーワード

ARRAY_MIN,ARRAY