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
-- Concatenate two arrays
f1 := ARRAY_CONCAT(ARRAY(1, 2), ARRAY(3, 4)),
-- Preserve order across inputs
f2 := ARRAY_CONCAT(ARRAY('a'), ARRAY('b', 'c')),
-- Multiple arrays in one call
f3 := ARRAY_CONCAT(ARRAY(1), ARRAY(2), ARRAY(3))
;Result
| f1 ARRAY | f2 ARRAY | f3 ARRAY |
|---|---|---|
| [1, 2, 3, 4] | [a, b, c] | [1, 2, 3] |