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

# `array_append` 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 12.2 LTS and above

Returns `array` appended by `elem`.

## Syntax

```
array_append(array, elem)
```

## Arguments

* `array`: An ARRAY.
* `elem`: An expression of the same type as the elements of `array`.

## Returns

An ARRAY of the same type as `array`.

## Examples

```sql
> SELECT array_append(array(1, 2, 3), 0);
 [1,2,3,0]

> SELECT array_append(array(1, 2, 3), NULL);
 [1,2,3,NULL]
```

## Related functions

* [`array_compact` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_compact.md)
* [`array_distinct` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_distinct.md)
* [`array_except` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_except.md)
* [`array_insert` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_insert.md)
* [`array_intersect` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_intersect.md)
* [`array_remove` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_remove.md)
* [`array_sort` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_sort.md)
* [`array_union` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/array_union.md)
* [`zip_with` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/zip_with.md)
