Skip to main content

median

The median* functions are the aliases for the corresponding quantile* functions. They calculate median of a numeric data sample.

Functions:

Example

Input table:

β”Œβ”€val─┐
β”‚ 1 β”‚
β”‚ 1 β”‚
β”‚ 2 β”‚
β”‚ 3 β”‚
β””β”€β”€β”€β”€β”€β”˜

Query:

SELECT medianDeterministic(val, 1) FROM t;

Result:

β”Œβ”€medianDeterministic(val, 1)─┐
β”‚ 1.5 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜