Reference material for MEDIAN
MEDIAN
returns the average of the two middle values.
Parameter | Description | Supported input types |
---|---|---|
<value> | The expression used to calculate the median value. | DOUBLE PRECISION , REAL , BIGINT , INT |
MEDIAN
returns a value of type DOUBLE PRECISION
.
NULL
values.NULL
.UNNEST
to convert an array [1,2,5] into a column, calculates the median value, and returns it as result
:
result (DOUBLE PRECISION) |
---|
2 |
UNNEST
to convert an array [100, NULL, 1, 2, 5] into a column, calculates the median value, and returns it as result
:
result (DOUBLE PRECISION) |
---|
3.5 |
NULL
elements is even after ignoring NULL
values. The average of the middle elements, 2
and 5
, is calculated as : ((2+5)/2)
.