ARRAY_CONCAT(...)

All functions > ARRAY > ARRAY_CONCAT(...)

Concatenates multiple arrays into a single combined array with optional deduplication.

Syntax

ARRAY_CONCAT(array [, array ...] [ DEDUPLICATE ON field [, field ...] ])

Notes

  • Combines multiple arrays into one
  • Preserves order of elements
  • Optional DEDUPLICATE ON clause removes duplicates based on specified fields
  • Empty arrays are handled gracefully

See also

Examples

FeatureQL
SELECT
    f1 := ARRAY_CONCAT(ARRAY[1, 2], ARRAY[3, 4]), -- Concatenate two arrays
    f2 := ARRAY_CONCAT(ARRAY['a'], ARRAY['b', 'c']), -- Preserve order across inputs
    f3 := ARRAY_CONCAT(ARRAY[1], ARRAY[2], ARRAY[3]) -- Multiple arrays in one call
;
Result
f1 ARRAYf2 ARRAYf3 ARRAY
[1, 2, 3, 4][a, b, c][1, 2, 3]

Last update at: 2026/05/26 17:22:09