ClickHouse/docs/zh/sql-reference/aggregate-functions/reference/groupuniqarray.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
528 B
Markdown
Raw Normal View History

2021-02-02 12:00:41 +00:00
---
2022-08-26 19:07:59 +00:00
slug: /zh/sql-reference/aggregate-functions/reference/groupuniqarray
2022-04-10 23:08:18 +00:00
sidebar_position: 111
2021-02-02 12:00:41 +00:00
---
# groupUniqArray {#groupuniqarray}
2021-02-05 16:07:17 +00:00
**语法**
2021-02-02 12:00:41 +00:00
2021-02-05 16:07:17 +00:00
``` sql
2021-03-18 16:02:22 +00:00
groupUniqArray(x)
2021-02-05 16:07:17 +00:00
2021-03-18 16:02:22 +00:00
groupUniqArray(max_size)(x)
2021-02-05 16:07:17 +00:00
```
2021-02-02 12:00:41 +00:00
2021-02-05 16:07:17 +00:00
从不同的参数值创建一个数组。 内存消耗和 [uniqExact](../../../sql-reference/aggregate-functions/reference/uniqexact.md) 函数是一样的。
第二个版本(带有 `max_size` 参数)将结果数组的大小限制为 `max_size` 个元素。
例如, `groupUniqArray(1)(x)` 相当于 `[any(x)]`.