array_length
Descriptionβ
Returns the number of elements in the array. The result type is INT. if the parameter is NULL, the result is also NULL.
Syntaxβ
array_length(any_array)
Examplesβ
mysql> select array_length([1,2,3]);
+-----------------------+
| array_length([1,2,3]) |
+-----------------------+
| 3 |
+-----------------------+
1 row in set (0.00 sec)
mysql> select array_length([[1,2], [3,4]]);
+-----------------------------+
| array_length([[1,2],[3,4]]) |
+-----------------------------+
| 2 |
+-----------------------------+
1 row in set (0.01 sec)
keywordβ
ARRAY_LENGTH,ARRAY