mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
fa93952231
See also #31076 which noted that links were broken but didn't fix.
36 lines
748 B
Markdown
36 lines
748 B
Markdown
---
|
||
slug: /zh/sql-reference/aggregate-functions/reference/anyheavy
|
||
sidebar_position: 103
|
||
---
|
||
|
||
# anyHeavy {#anyheavyx}
|
||
|
||
选择一个频繁出现的值,使用[heavy hitters](https://doi.org/10.1145/762471.762473) 算法。 如果某个值在查询的每个执行线程中出现的情况超过一半,则返回此值。 通常情况下,结果是不确定的。
|
||
|
||
``` sql
|
||
anyHeavy(column)
|
||
```
|
||
|
||
**参数**
|
||
|
||
- `column` – The column name。
|
||
|
||
**示例**
|
||
|
||
使用 [OnTime](../../../getting-started/example-datasets/ontime.md) 数据集,并选择在 `AirlineID` 列任何频繁出现的值。
|
||
|
||
查询:
|
||
|
||
``` sql
|
||
SELECT anyHeavy(AirlineID) AS res
|
||
FROM ontime;
|
||
```
|
||
|
||
结果:
|
||
|
||
``` text
|
||
┌───res─┐
|
||
│ 19690 │
|
||
└───────┘
|
||
```
|