Lists & arrays
Scalar
list_concat()
Concatenates lists. NULL inputs are skipped. See also operator ||.
Arguments & returns
list_concat(…)
Scalar
| Overload link | … Varargs | Returns |
|---|---|---|
| #01 | ANY[] |
ANY[] |
… accepts a variable number of arguments of the type shown.
Example
Haybarn WASM 1.5.5-rc3 · In your browser
Engine example · Run to view results.
In other engines
PostgreSQLarray_cat()
ARRAY_CAT(ARRAY[1, 2], ARRAY[3, 4])
LIST_CONCAT([1, 2], [3, 4])
BigQueryarray_concat()
ARRAY_CONCAT([1, 2], [3, 4])
LIST_CONCAT([1, 2], [3, 4])
Snowflakearray_cat()
ARRAY_CAT([1, 2], [3, 4])
LIST_CONCAT([1, 2], [3, 4])
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)
CASE WHEN [1, 2, 3] IS NULL THEN NULL ELSE LIST_CONCAT([99], [1, 2, 3]) END