Skip to main content
Returns an approximate percentile of the input values. Pass one fraction to get one percentile, or an array of fractions to get several percentiles from a single pass over the data. For an exact result, use PERCENTILE_CONT. NULL values are ignored.

Syntax

Parameters

Return type

With <fraction>, the function returns a single value. With <fractions>, it returns an array with one element per fraction, in the order of <fractions>. The value type is the type of <expression> for NUMERIC, DATE, TIMESTAMP and TIMESTAMPTZ inputs, and DOUBLE PRECISION otherwise.

Examples

Rows: 1Execution time: 2.74ms

Compute several percentiles at once:

Rows: 1Execution time: 2.10ms