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

> Computes multiple approximate quantiles with relative-error guarantees at different levels simultaneously.

# quantilesDD

<h2 id="quantilesDD">
  quantilesDD
</h2>

Introduced in: v24.1.0

Computes multiple approximate [quantiles](https://en.wikipedia.org/wiki/Quantile) of a sample with relative-error guarantees at different levels simultaneously.

This function is equivalent to [`quantileDD`](/reference/functions/aggregate-functions/quantileddsketch) but allows computing multiple quantile levels in a single pass, which is more efficient than calling individual quantile functions.

**Syntax**

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

**Parameters**

* `relative_accuracy` — Relative accuracy of the quantiles. Possible values are in the range from 0 to 1. The recommended value is 0.001 or higher. [`Float*`](/reference/data-types/float)
* `level` — Levels of quantiles. One or more constant floating-point numbers from 0 to 1. We recommend using `level` values in the range of `[0.01, 0.99]`. [`Float*`](/reference/data-types/float)

**Arguments**

* `expr` — Expression over the column values resulting in numeric data types, `Date` or `DateTime`. [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Date`](/reference/data-types/date) or [`DateTime`](/reference/data-types/datetime)

**Returned value**

Array of approximate quantiles of the specified levels in the same order as the levels were specified. For `Date` and `DateTime` inputs the output format matches the input format. [`Array(Float64)`](/reference/data-types/array) or [`Array(Date)`](/reference/data-types/array) or [`Array(DateTime)`](/reference/data-types/array)

**Examples**

**Computing multiple quantiles with a DDSketch**

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

```response title=Response theme={null}
┌─quantilesDD(0.01, 0.25, 0.5, 0.75)(number)────────────────┐
│ [1.9936617014173448,4.0148353330285875,5.989510371172621] │
└───────────────────────────────────────────────────────────┘
```
