Skip to main content

ARRAY_TO_STRING

Categories: Conversion, Semi-Structured Data

ARRAY_TO_STRING

Returns a string of the values from the input array, with the values separated by the specified delimiter string.

Syntax

ARRAY_TO_STRING(arr LIST, delimiter VARCHAR) → VARCHAR

  • arr: The source array.
  • delimiter: The string to place between each element in the array.

Examples

ARRAY_TO_STRING example
SELECT ARRAY_TO_STRING(ARRAY[1, 2, 3], ',')
-- 1,2,3
array_col contains ARRAY[1, NULL, 3]
SELECT ARRAY_TO_STRING(array_col, ',')
-- 1,,3