Files
doris/docs/en/sql-reference/sql-functions/aggregate-functions/percentile.md
2021-08-22 22:03:07 +08:00

1.6 KiB

title, language
title language
PERCENTILE en

PERCENTILE

Description

Syntax

PERCENTILE(expr, DOUBLE p)

Calculate the exact percentile, suitable for small data volumes. Sort the specified column in descending order first, and then take the exact p-th percentile. The value of p is between 0 and 1

Parameter Description: expr: required. The value is an integer (bigint at most). p: The exact percentile is required. The value is [0.0,1.0]

example

MySQL > select `table`, percentile(cost_time,0.99) from log_statis group by `table`;
+---------------------+---------------------------+
| table    |         percentile(`cost_time`, 0.99)|
+----------+--------------------------------------+
| test     |                                54.22 |
+----------+--------------------------------------+

keyword

PERCENTILE