> ## 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_CONCAT function

# ARRAY_CONCAT

**Alias:** `ARRAY_CAT`

Combines one or more arrays that are passed as arguments.

## Syntax

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
ARRAY_CONCAT(<array> [, ...n])
```

**—OR—**

```sql theme={"theme":{"light":"css-variables","dark":"css-variables"}}
<expression> || <expression>
```

## Parameters

| Parameter          | Description                                                                            | Supported input types |
| :----------------- | :------------------------------------------------------------------------------------- | :-------------------- |
| `<array> [, ...n]` | The arrays to be combined. If only one array is given, an identical array is returned. | `ARRAY`               |

### `||` operator

| Parameter      | Description                         | Supported input types                      |
| :------------- | :---------------------------------- | :----------------------------------------- |
| `<expression>` | The expressions to be concatenated. | `TEXT` / `ARRAY`, but at least one `ARRAY` |

To enable array concatenation, one parameter to the `||` operator must be of type `ARRAY`, while the other parameter can be a string whose value can be converted to the underlying type of the array parameter, or it can be an array of the same type.

If one parameter to the `||` operator is `NULL`, the result will be the non-null parameter; if both parameters are `NULL`, the result will be `NULL`.

The concatenation operator `||` can also be used for [string concatenation](/reference-sql/functions-reference/string/concat).

## Return Type

`ARRAY` of the same type as the input arrays

## Examples

In the following example, two arrays are combined to show all of the levels in a particular game:

<div className="query-window">
  ```
  SELECT ARRAY_CONCAT([1, 2, 3, 4], [5, 6, 7, 8, 9, 10]) AS levels;
  ```

  | levels <span>array(int)</span>   |
  | :------------------------------- |
  | \[1, 2, 3, 4, 5, 6, 7, 8, 9, 10] |

  <p><span>Rows: 1</span><span>Execution time: 9.26ms</span></p>
</div>

The following example concatenates two integer arrays:

<div className="query-window">
  ```
  SELECT ARRAY[1,2] || ARRAY[3];
  ```

  | ?column? <span>array(int)</span> |
  | :------------------------------- |
  | \[1, 2, 3]                       |

  <p><span>Rows: 1</span><span>Execution time: 7.99ms</span></p>
</div>

The following example concatenates a string, whose value can be converted to integer, with an integer array:

<div className="query-window">
  ```
  SELECT '{2}' || ARRAY[1];
  ```

  | ?column? <span>array(int null)</span> |
  | :------------------------------------ |
  | \[2, 1]                               |

  <p><span>Rows: 1</span><span>Execution time: 6.14ms</span></p>
</div>
