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

> Reference material for ARRAY_FLATTEN function

# ARRAY_FLATTEN

Converts an array of arrays into a flat array. For every element that is an array, this function extracts its elements into the new array. The resulting flattened array contains all the elements from all source arrays.

The function:

* Applies to one level of nested arrays.
* Does not accept arrays that are already flat.

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
ARRAY_FLATTEN(<array>)
```

## Parameters

| Parameter | Description                         | Supported input types        |
| :-------- | :---------------------------------- | :--------------------------- |
| `<array>` | The array of arrays to be flattened | Any `ARRAY` of `ARRAY` types |

## Return Type

`ARRAY` of the same type as the input array

## Example

The following example flattens multiple arrays of level IDs:

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	ARRAY_FLATTEN([ [ [ 1, 2 ] ], [ [ 2, 3 ], [ 3, 4 ] ] ])
```

**Returns**: `[ [ 1, 2 ], [ 2, 3 ], [ 3, 4 ] ]`
