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

UNNEST



Unnests the array and returns the set of elements.

Syntax

UNNEST( <array> )

Examples

SELECT UNNEST([1, 2]); ┌─────────────────┐ │ unnest([1, 2]) │ ├─────────────────┤ │ 1 │ │ 2 │ └─────────────────┘ -- UNNEST(array) can be used as a table function. SELECT * FROM UNNEST([1, 2]); ┌─────────────────┐ │ value │ ├─────────────────┤ │ 1 │ │ 2 │ └─────────────────┘

Was this page helpful?