This documentation is related to an older version of Firebolt. For the most current documentation, see Firebolt documentation.
ARRAY_TO_STRING
Concatenates an array of TEXT
elements using an optional delimiter. If no delimiter is provided, an empty string is used instead.
Syntax
ARRAY_TO_STRING(<array>[, <delimiter>])
Parameters
Parameter | Description | Supported input types |
---|---|---|
<array> | An array to be concatenated | ARRAY TEXT |
<delimiter> | The delimiter used for concatenating the array elements | TEXT |
Return Type
TEXT
Example
In the example below, the three elements are concatenated with no delimiter.
SELECT
ARRAY_TO_STRING([ '1', '2', '3' ]) AS levels;
Returns: 123
In this example below, the levels are concatenated separated by a comma.
SELECT
ARRAY_TO_STRING([ '1', '2', '3' ], ',') AS levels;
Returns: 1,2,3