> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> 精确地同时计算不同级别的多个分位数，并在元素数量为偶数时返回较大的中间值。

# quantilesExactHigh

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

引入版本：v20.8.0

精确地同时计算数值数据序列在不同级别上的多个[分位数](https://en.wikipedia.org/wiki/Quantile)。当级别为 `0.5` 且元素个数为偶数时，返回两个中间值中较大的那个。

此函数等同于 [`quantileExactHigh`](/docs/zh/reference/functions/aggregate-functions/quantileExactHigh)，但支持在一次遍历中计算多个分位数级别，因此比单独调用各个分位数函数更高效。

**语法**

```sql theme={null}
quantilesExactHigh(level1, level2, ...)(expr)
```

**参数**

* `level` — 分位数的级别。一个或多个从 0 到 1 的常量浮点数。建议将 `level` 值设在 `[0.01, 0.99]` 范围内。[`Float*`](/docs/zh/reference/data-types/float)

**参数**

* `expr` — 基于列值计算的表达式，结果为数值数据类型、`Date`、`DateTime` 或 `DateTime64`。[`(U)Int*`](/docs/zh/reference/data-types/int-uint) 或 [`Float*`](/docs/zh/reference/data-types/float) 或 [`Decimal*`](/docs/zh/reference/data-types/decimal) 或 [`Date`](/docs/zh/reference/data-types/date) 或 [`DateTime`](/docs/zh/reference/data-types/datetime) 或 [`DateTime64`](/docs/zh/reference/data-types/datetime64)

**返回值**

按指定级别返回的分位数数组，顺序与级别的指定顺序一致。对于数值数据类型，输出格式与输入格式一致。[`Array((U)Int*)`](/docs/zh/reference/data-types/array) 或 [`Array(Float*)`](/docs/zh/reference/data-types/array) 或 [`Array(Decimal*)`](/docs/zh/reference/data-types/array) 或 [`Array(Date)`](/docs/zh/reference/data-types/array) 或 [`Array(DateTime)`](/docs/zh/reference/data-types/array) 或 [`Array(DateTime64)`](/docs/zh/reference/data-types/array)

**示例**

**计算多个精确高分位数**

```sql title=Query theme={null}
SELECT quantilesExactHigh(0.25, 0.5, 0.75)(number) FROM numbers(10)
```

```response title=Response theme={null}
┌─quantilesExactHigh(0.25, 0.5, 0.75)(number)─┐
│ [2,5,7]                                     │
└─────────────────────────────────────────────┘
```
