ARRAY_JOIN

All functions > ARRAY > ARRAY_JOIN

Joins the elements of an array into a single string using a specified delimiter.

Syntax

ARRAY_JOIN(array, delimiter[, null_replacement])
sql

Arguments

ParameterTypeRequiredDescription
arrayARRAYVARCHARYesArray of strings to join together
delimiterVARCHARYesString to insert between array elements
null_replacementVARCHARNoOptional replacement string for NULL values

Returns

A single string with array elements joined by the delimiter

Notes

  • Joins array elements into a single string using the specified delimiter
  • NULL values are omitted unless a replacement string is provided
  • Empty arrays return an empty string
  • Single element arrays return just that element (no delimiter)
  • Useful for creating CSV-like output or human-readable lists

Examples

Last update at: 2025/10/13 10:23:46