📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

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 │ └──────────────────┘

Was this page helpful?