> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 異なる引数値から配列を作成します。

# groupUniqArray

<div id="groupUniqArray">
  ## groupUniqArray
</div>

導入バージョン: v1.1.0

異なる引数値からなる配列を作成します。
この関数のメモリ使用量は、[`uniqExact`](/ja/reference/functions/aggregate-functions/uniqExact) 関数と同じです。

**構文**

```sql theme={null}
groupUniqArray(x)
groupUniqArray(max_size)(x)
```

**パラメータ**

* `max_size` — 結果の配列の要素数を `max_size` に制限します。`groupUniqArray(1)(x)` は `[any(x)]` と同等です。[`UInt64`](/ja/reference/data-types/int-uint)

**引数**

* `x` — 式。[`Any`](/ja/reference/data-types/index)

**戻り値**

一意の値からなる配列を返します。[`Array`](/ja/reference/data-types/array)

**例**

**使用例**

```sql title=Query theme={null}
CREATE TABLE t (x UInt8) ENGINE = Memory;
INSERT INTO t VALUES (1), (2), (1), (3), (2), (4);

SELECT groupUniqArray(x) FROM t;
```

```response title=Response theme={null}
┌─groupUniqArray(x)─┐
│ [1,2,3,4]         │
└───────────────────┘
```

**max\_size パラメータを指定した場合**

```sql title=Query theme={null}
SELECT groupUniqArray(2)(x) FROM t;
```

```response title=Response theme={null}
┌─groupUniqArray(2)(x)─┐
│ [1,2]                │
└──────────────────────┘
```
