Back to Starrocks

array_append

docs/en/sql-reference/sql-functions/array-functions/array_append.md

4.1.0674 B
Original Source

array_append

Adds a new element to the end of the array. Returns an array.

Syntax

Haskell
array_append(any_array, any_element)

Examples

plain
mysql> select array_append([1, 2], 3);
+------------------------+
| array_append([1,2], 3) |
+------------------------+
| [1,2,3]                |
+------------------------+
1 row in set (0.00 sec)

You can add NULL to the array.

plain
mysql> select array_append([1, 2], NULL);
+---------------------------+
| array_append([1,2], NULL) |
+---------------------------+
| [1,2,NULL]                |
+---------------------------+
1 row in set (0.01 sec)

keyword

ARRAY_APPEND,ARRAY