list_concat()

Concatenates two lists.

Arguments & returns

list_concat(…)

Scalar
Overload link … Varargs Returns
#01 ANY[] ANY[]

… accepts a variable number of arguments of the type shown.

Example

list_concat example
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

Catalog examples

SELECT
  list_concat([2, 3], [4, 5, 6]);

In other engines

PostgreSQLarray_cat()

ARRAY_CAT(ARRAY[1, 2], ARRAY[3, 4])
In DuckDB
LIST_CONCAT([1, 2], [3, 4])

SQLGlot example ↗

BigQueryarray_concat()

ARRAY_CONCAT([1, 2], [3, 4])
In DuckDB
LIST_CONCAT([1, 2], [3, 4])

SQLGlot example ↗

Snowflakearray_cat()

ARRAY_CAT([1, 2], [3, 4])
In DuckDB
LIST_CONCAT([1, 2], [3, 4])

SQLGlot example ↗

Used in larger rewrites 1

These examples use list_concat as one part of a larger SQL translation.

Apache Spark

ARRAY_INSERT(ARRAY(1, 2, 3), 1, 99)
In DuckDB
CASE WHEN [1, 2, 3] IS NULL THEN NULL ELSE LIST_CONCAT([99], [1, 2, 3]) END

SQLGlot example ↗