📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ARRAY_SIZE



Returns the length of an array, counting NULL elements.

Alias: ARRAY_LENGTH

Syntax

ARRAY_SIZE(<array>)

Return Type

BIGINT

Examples

SELECT ARRAY_SIZE([1, 2, 3]) AS size_plain; ┌──────────┐ │ size_plain │ ├──────────┤ │ 3 │ └──────────┘
SELECT ARRAY_SIZE([1, NULL, 3]) AS size_with_null; ┌──────────────┐ │ size_with_null│ ├──────────────┤ │ 3 │ └──────────────┘

Was this page helpful?