Computes the median of a dataset.
Last updated 2 years ago
Was this helpful?
order_by_expression: The expression to sort and compute the median for.
Examples
SELECT MEDIAN(pop) FROM eth.recent_blocks -- EXPR$0 -- 2783.0
This function is used with only numeric data types in Spice. NULL values in the data set are ignored.
NULL
This function is equivalent to .
PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY order_by_expression)