Skip to main content

ARRAY_TO_STRING

Concatenates the string elements of an array into a single string, separated by a delimiter. NULL elements are skipped.

Syntax

ARRAY_TO_STRING(<array_of_strings>, <delimiter>)

Return Type

STRING

Examples

SELECT ARRAY_TO_STRING(['a', 'b', 'c'], ',') AS joined;

┌────────┐
│ joined │
├────────┤
│ a,b,c │
└────────┘
SELECT ARRAY_TO_STRING([NULL, 'x', 'y'], '-') AS joined_no_nulls;

┌──────────────────┐
│ joined_no_nulls │
├──────────────────┤
│ x-y │
└──────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today