Skip to content

min_val()

Get the minimum value from a `tdigest`

Since 1.0.0

Get the minimum value from a tdigest. This accessor allows you to calculate the minimum alongside percentiles, without needing to create two separate aggregates from the same raw data.

Get the minimum of the integers from 1 to 100.

SELECT min_val(tdigest(100, data))
FROM generate_series(1, 100) data;
min_val
---------
1

The syntax is:

min_val(
digest TDigest
) RETURNS DOUBLE PRECISION
NameTypeDefaultRequiredDescription
digestTDigest-The digest to extract the minimum value from
ColumnTypeDescription
min_valDOUBLE PRECISIONThe minimum value entered into the tdigest