expr with linear interpolation.
Syntax
Parameters
-
expr: the expression by which to order the values. It must be of numeric data types, DATE, or DATETIME. For example, if you want to find the median score of physics, specify the column that contains the physics scores. -
percentile: the percentile of the value you want to find. It is a constant floating-point number from 0 to 1. For example, if you want to find the median value, set this parameter to0.5.
Return value
Returns a value that is at the specified percentile. If no input value lies exactly at the desired percentile, the result is calculated using linear interpolation of the two nearest input values. The data type is the same asexpr.
Usage notes
This function ignores NULLs.Examples
Suppose there is a table namedexam with the following data.