ClickHouse/docs/en/sql-reference/aggregate-functions/reference/anyheavy.md

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

32 lines
769 B
Markdown
Raw Normal View History

---
2022-08-28 14:53:34 +00:00
slug: /en/sql-reference/aggregate-functions/reference/anyheavy
sidebar_position: 103
---
2022-06-02 10:55:18 +00:00
# anyHeavy
Selects a frequently occurring value using the [heavy hitters](https://doi.org/10.1145/762471.762473) algorithm. If there is a value that occurs more than in half the cases in each of the querys execution threads, this value is returned. Normally, the result is nondeterministic.
``` sql
anyHeavy(column)
```
**Arguments**
- `column` The column name.
**Example**
2022-04-11 05:01:34 +00:00
Take the [OnTime](../../../getting-started/example-datasets/ontime.md) data set and select any frequently occurring value in the `AirlineID` column.
``` sql
SELECT anyHeavy(AirlineID) AS res
FROM ontime
```
``` text
┌───res─┐
│ 19690 │
└───────┘
```