MEDIAN
Categories: Percentile
MEDIAN
Computes the median of a dataset.
Syntax
MEDIAN(order_by_expression numeric) → double precision
- order_by_expression: The expression to sort and compute the median for.
Examples
MEDIAN exampleSELECT MEDIAN(pop) FROM Samples."samples.dremio.com"."zips.json"
-- EXPR$0
-- 2783.0
Usage Notes
This function is used with only numeric data types in Dremio. NULL
values in the data set are ignored.
PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY order_by_expression)
.