Files
doris/docs/documentation/cn/sql-reference/sql-functions/aggregate-functions/percentile_approx.md
xy720 4c2a3d6da4 Merge Help document to documentation (#1586)
Help document collation (integration of help and documentation documents)
2019-08-07 21:31:53 +08:00

693 B
Executable File

PERCENTILE_APPROX

description

Syntax

PERCENTILE_APPROX(expr, DOUBLE p)

返回第p个百分位点的近似值,p的值介于0到1之间

该函数使用固定大小的内存,因此对于高基数的列可以使用更少的内存,可用于计算tp99等统计值

example

MySQL > select `table`, percentile_approx(cost_time,0.99) from log_statis group by `table`;
+---------------------+---------------------------+
| table    | percentile_approx(`cost_time`, 0.99) |
+----------+--------------------------------------+
| test     |                                54.22 |
+----------+--------------------------------------+
##keyword
PERCENTILE_APPROX,PERCENTILE,APPROX