> ## 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.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.firebolt.io/feedback

```json
{
  "path": "/reference-sql/functions-reference/array/array-to-string",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

> Reference material for ARRAY_TO_STRING function

# ARRAY_TO_STRING

Converts each array element to its text representation, and concatenates those using an optional delimiter. If no delimiter is provided, an empty string is used instead. `NULL` array elements are omitted.

**Alias:** `ARRAY_JOIN`

## Syntax

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
ARRAY_TO_STRING(<array>[, <delimiter>])
```

## Parameters

| Parameter     | Description                                             | Supported input types |
| :------------ | :------------------------------------------------------ | :-------------------- |
| `<array>`     | An array to be concatenated                             | `ARRAY`               |
| `<delimiter>` | The delimiter used for concatenating the array elements | `TEXT`                |

## Return Type

`TEXT`

## Example

In the example below, the three elements are concatenated with no delimiter.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	ARRAY_TO_STRING([ '1', '2', '3' ]) AS levels;
```

**Returns**: `123`

In this example below, the levels are concatenated separated by a comma.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	ARRAY_TO_STRING([ '1', '2', '3' ], ',') AS levels;
```

**Returns**: `1,2,3`

In this example below, the elements of a nested array containing a `NULL` are concatenated.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
	ARRAY_TO_STRING([ [ 1, 2 ], [3, 4], [NULL, 5] ], ',') AS levels;
```

**Returns**: `1,2,3,4,5`
