MERGE(...)

All functions > ROW > MERGE(...)

Merges multiple row structures into a single row with combined fields

Syntax

MERGE(row, row, ...)

Notes

  • Requires at least 2 rows to merge
  • All field names must be unique across all rows
  • Fields are combined in order from left to right
  • Throws error if duplicate field names exist

Examples

FeatureQL
SELECT
    f1 := MERGE(ROW(1 AS col1, 'a' AS col2), ROW(1E0 AS col3, TRUE AS col4)), -- Merge two rows with different fields
    f2 := MERGE(ROW(1 AS col1, 'a' AS col2), ROW(1E0 AS col3, TRUE AS col4), ROW(1 AS col5)) -- Merge three rows
;
Result
f1 ROWf2 ROW
{col1: 1, col2: a, col3: 1.0, col4: true}{col1: 1, col2: a, col3: 1.0, col4: true, col5: 1}

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