ARRAY_TO_STRING
functionsupportedCore SQL functionsReturns an input array converted to a string by casting all values to strings (using TO_VARCHAR) and concatenating them (using the string from the second argument to separate the elements).
Syntax
ARRAY_TO_STRING( <array> , <separator_string> )
Parameters
| Name | Required | Description |
|---|---|---|
array | required | The array of elements to convert to a string. |
separator_string | required | The string to put between each element, typically a space, comma, or other human-readable separator. |
Returns
This function returns a value of type VARCHAR.
Usage notes
- A NULL argument returns NULL as a result.
- A NULL in an array is converted to an empty string in the result.
- To include a blank space between values, you must precede the space with the separator character (e.g. ', '). See the examples below.