SQL Reference
...
SQL Functions
JSON Functions
JSON_ARRAY_LENGTH
7min
The JSON_ARRAY_LENGTH() function returns the length of a specified JSON array.
This function has the following basic syntax.

The required argument for this function is arrayval. It represents the JSON array which we will count the length.
The following example returns the number of elements in the array:

The function above will return the following result:

The following example returns the number of elements in the array.

You will get the final result as follows:

This example shows that an empty JSON array will return 0.

An empty array will return 0 in the final output:


Updated 09 Oct 2023

Did this page help you?