BIT_XOR() GROUP BY ...

All functions > GROUP BY > BIT_XOR() GROUP BY ...

Returns the bitwise XOR of all integer values in the group.

Syntax

BIT_XOR(expr)
 [ FILTER (WHERE condition) ]
  [ GROUP BY feature [, feature ...] ]

Notes

  • NULL values are ignored where the underlying aggregate skips NULLs
  • Can be used with FILTER (WHERE condition) and GROUP BY like other aggregates
  • Argument type must be an integer type

Examples

FeatureQL
SELECT
    f1 := ZIP(ARRAY[1, 1] AS g, ARRAY[3, 5] AS x).TRANSFORM(SELECT BIT_XOR(x) GROUP BY g).UNWRAP_ONE() -- Bitwise XOR over one group
;
Result
f1 BIGINT
6

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