description |
---|
Computes the median of a dataset. |
- order_by_expression: The expression to sort and compute the median for.
Examples
{% code title="MEDIAN example" %}
SELECT MEDIAN(pop)
FROM eth.recent_blocks
-- EXPR$0
-- 2783.0
{% endcode %}
This function is used with only numeric data types in Spice. NULL
values in the data set are ignored.
This function is equivalent to PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY order_by_expression)
.