groupUniqArray
Introduced in: v1.1.0
Creates an array from different argument values.
The memory consumption of this function is the same as for the uniqExact function.
Syntax
groupUniqArray(x)
groupUniqArray(max_size)(x)
Parameters
max_size — Limits the size of the resulting array to max_size elements. groupUniqArray(1)(x) is equivalent to [any(x)]. UInt64
Arguments
Returned value
Returns an array of unique values. Array
Examples
Usage example
CREATE TABLE t (x UInt8) ENGINE = Memory;
INSERT INTO t VALUES (1), (2), (1), (3), (2), (4);
SELECT groupUniqArray(x) FROM t;
┌─groupUniqArray(x)─┐
│ [1,2,3,4] │
└───────────────────┘
With max_size parameter
SELECT groupUniqArray(2)(x) FROM t;
┌─groupUniqArray(2)(x)─┐
│ [1,2] │
└──────────────────────┘
Last modified on June 8, 2026