> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UNNEST

> UNNEST in Query Engine SQL.

<Note>
  This function isn't in the updated function reference yet. The details below come from the previous docs, and the product team is confirming them.
</Note>

## Syntax

UNNEST( \<array\_expr> )

UNNEST transforms an ARRAY into a table, generating a separate row for each element within the ARRAY.

Supported Datatypes, array

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
> SELECT * FROM UNNEST(ARRAY[10,20,30]) as numbers
|10
|20
|30

> WITH Sequences AS
  (SELECT 1 AS id, array[0, 1, 1, 2, 3, 5] AS some_numbers
   UNION ALL SELECT 2 AS id, array[2, 4, 8, 16, 32] AS some_numbers
   UNION ALL SELECT 3 AS id, array[5, 10] AS some_numbers)
SELECT id, flattened_numbers
FROM Sequences
CROSS JOIN UNNEST(Sequences.some_numbers) AS flattened_numbers
order by 1,2;
|1    |0
|1    |1
|1    |1
|1    |2
|1    |3
|1    |5
|2    |2
|2    |4
|2    |8
|2    |16
|2    |32
|3    |5
|3    |10
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.