median
Function
The median function is used to calculate the median of the input parameters.
Syntax
median(colname)
Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| colname | Yes | DOUBLE, DECIMAL, STRING, or BIGINT | Represents the column name to be sorted. Elements in the column are of type DOUBLE. When elements in the column are not of type DOUBLE, they are implicitly converted to DOUBLE type before computation. |
Return Values
Returns a value of type DOUBLE or DECIMAL.
If the column name does not exist, an error is returned.
Examples
Assume the elements in column int_test are 1, 2, 3, 4, of type INT.
Returns 2.5.
select median(int_test) FROM int_test;
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot