---
title: array_join function
description: Learn the syntax of the array\_join function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/array_join
---

# `array_join` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Concatenates the elements of `array`.

## Syntax

```
array_join(array, delimiter [, nullReplacement])
```

## Arguments

* `array`: Any `ARRAY` type, but its elements are interpreted as strings.
* `delimiter`: A `STRING` used to separate the concatenated array elements.
* `nullReplacement`: A `STRING` used to express a `NULL` value in the result.

## Returns

A `STRING` where the elements of `array` are separated by `delimiter` and null elements are substituted for `nullReplacement`.
If `nullReplacement` is omitted, null elements are filtered out.
If any argument is `NULL`, the result is `NULL`.

## Examples

```sql
> SELECT array_join(array('hello', 'world'), ',');
 hello,world

> SELECT array_join(array('hello', NULL ,'world'), ',');
 hello,world

> SELECT array_join(array('hello', NULL ,'world'), ',', '*');
 hello,*,world
```

## Related functions

* [`concat` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/concat.md)
* [`concat_ws` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/concat_ws.md)
