{"Entry":{"collection":"func","key":"percentile-disc","name":"percentile_disc","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.3","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"9.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"be8ee6ab13318b472128748bc3ed88cdc0de35bed099add23dc85dc347243633","first_version":"9.4","group":"aggregate","group_label":"Aggregate Functions","groups":["aggregate"],"imported_at":"2026-09-14T21:49:48.864107+08:00","last_version":"20","name":"percentile_disc","name_key":"percentile_disc","position":21035,"present_in":["9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"percentile_disc ( fraction double precision ) WITHIN GROUP ( ORDER BY anyelement ) → anyelement","signature_count":2,"slug":"percentile-disc","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","summary":"Computes the discrete percentile, the first value within the ordered set of aggregated argument values whose position in the ordering equals or exceeds the specified fraction.","summary_zh":""}},"Definition":{"Collection":"func","Key":"percentile-disc","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"percentile-disc","SourceRevision":"2026-09-14T13:14:25.684213+00:00@99e6866c","Facts":{"description":"Computes the discrete percentile, the first value within the ordered set of aggregated argument values whose position in the ordering equals or exceeds the specified fraction. The aggregated argument must be of a sortable type.","description_html":"Computes the \u003cem class=\"firstterm\"\u003ediscrete percentile\u003c/em\u003e, the first value within the ordered set of aggregated argument values whose position in the ordering equals or exceeds the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e. The aggregated argument must be of a sortable type.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-ORDEREDSET-TABLE","file":"functions-aggregate.html","slug":"18"},"group":"aggregate","group_label":"Aggregate Functions","lang":"en","layout":"table-new","pages":["functions-aggregate.html"],"prose_only":false,"signatures":[{"description":"Computes the discrete percentile, the first value within the ordered set of aggregated argument values whose position in the ordering equals or exceeds the specified fraction. The aggregated argument must be of a sortable type.","description_html":"Computes the \u003cem class=\"firstterm\"\u003ediscrete percentile\u003c/em\u003e, the first value within the ordered set of aggregated argument values whose position in the ordering equals or exceeds the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e. The aggregated argument must be of a sortable type.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epercentile_disc\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e ) \u003ccode class=\"literal\"\u003eWITHIN GROUP\u003c/code\u003e ( \u003ccode class=\"literal\"\u003eORDER BY\u003c/code\u003e \u003ccode class=\"type\"\u003eanyelement\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003eanyelement\u003c/code\u003e","returns":"anyelement","text":"percentile_disc ( fraction double precision ) WITHIN GROUP ( ORDER BY anyelement ) → anyelement","zh_from":""},{"description":"Computes multiple discrete percentiles. The result is an array of the same dimensions as the fractions parameter, with each non-null element replaced by the input value corresponding to that percentile. The aggregated argument must be of a sortable type.","description_html":"Computes multiple discrete percentiles. The result is an array of the same dimensions as the \u003cem class=\"parameter\"\u003e\u003ccode\u003efractions\u003c/code\u003e\u003c/em\u003e parameter, with each non-null element replaced by the input value corresponding to that percentile. The aggregated argument must be of a sortable type.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epercentile_disc\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efractions\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003edouble precision[]\u003c/code\u003e ) \u003ccode class=\"literal\"\u003eWITHIN GROUP\u003c/code\u003e ( \u003ccode class=\"literal\"\u003eORDER BY\u003c/code\u003e \u003ccode class=\"type\"\u003eanyelement\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003eanyarray\u003c/code\u003e","returns":"anyarray","text":"percentile_disc ( fractions double precision[] ) WITHIN GROUP ( ORDER BY anyelement ) → anyarray","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-ORDEREDSET-TABLE","file":"functions-aggregate.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"percentile-disc","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"percentile_disc","Summary":"计算离散百分位数，即聚合参数值的有序集合中的第一个值，该值在排序中的位置等于或超过指定的fraction。聚合参数必须是可排序类型。","BodyHTML":"计算\u003cem\u003e离散百分位数\u003c/em\u003e，即聚合参数值的有序集合中的第一个值，该值在排序中的位置等于或超过指定的\u003cem\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e。聚合参数必须是可排序类型。\u003cpre\u003epercentile_disc ( fraction double precision ) WITHIN GROUP ( ORDER BY anyelement ) → anyelement\u003c/pre\u003e计算\u003cem\u003e离散百分位数\u003c/em\u003e，即聚合参数值的有序集合中的第一个值，该值在排序中的位置等于或超过指定的\u003cem\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e。聚合参数必须是可排序类型。\u003cpre\u003epercentile_disc ( fractions double precision[] ) WITHIN GROUP ( ORDER BY anyelement ) → anyarray\u003c/pre\u003e计算多个离散百分位数。结果是一个与\u003cem\u003e\u003ccode\u003efractions\u003c/code\u003e\u003c/em\u003e参数具有相同维数的数组，每个非空元素都被对应于该百分位数的输入值替换。聚合参数必须是可排序类型。","SourceRevision":"ca936764","ContentHash":"a0487a952452b5988e5d17da31d14aae6241ea6becf616b460b46a348cdec2c4","Payload":{"description_zh":"计算离散百分位数，即聚合参数值的有序集合中的第一个值，该值在排序中的位置等于或超过指定的fraction。聚合参数必须是可排序类型。","description_zh_html":"计算\u003cem class=\"firstterm\"\u003e离散百分位数\u003c/em\u003e，即聚合参数值的有序集合中的第一个值，该值在排序中的位置等于或超过指定的\u003cem class=\"parameter\"\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e。聚合参数必须是可排序类型。","signatures":[{"description_zh":"计算离散百分位数，即聚合参数值的有序集合中的第一个值，该值在排序中的位置等于或超过指定的fraction。聚合参数必须是可排序类型。","description_zh_html":"计算\u003cem class=\"firstterm\"\u003e离散百分位数\u003c/em\u003e，即聚合参数值的有序集合中的第一个值，该值在排序中的位置等于或超过指定的\u003cem class=\"parameter\"\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e。聚合参数必须是可排序类型。","returns":"anyelement","text":"percentile_disc ( fraction double precision ) WITHIN GROUP ( ORDER BY anyelement ) → anyelement","zh_from":"doc"},{"description_zh":"计算多个离散百分位数。结果是一个与fractions参数具有相同维数的数组，每个非空元素都被对应于该百分位数的输入值替换。聚合参数必须是可排序类型。","description_zh_html":"计算多个离散百分位数。结果是一个与\u003cem class=\"parameter\"\u003e\u003ccode\u003efractions\u003c/code\u003e\u003c/em\u003e参数具有相同维数的数组，每个非空元素都被对应于该百分位数的输入值替换。聚合参数必须是可排序类型。","returns":"anyarray","text":"percentile_disc ( fractions double precision[] ) WITHIN GROUP ( ORDER BY anyelement ) → anyarray","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"54965c82a806b21cd6b5da725d7cb0a5071430c7d5e96d0eda539abf7a365687","Text":"percentile_disc ( fraction double precision ) WITHIN GROUP ( ORDER BY anyelement ) → anyelement","Returns":"anyelement","Payload":{"description":"Computes the discrete percentile, the first value within the ordered set of aggregated argument values whose position in the ordering equals or exceeds the specified fraction. The aggregated argument must be of a sortable type.","description_html":"Computes the \u003cem class=\"firstterm\"\u003ediscrete percentile\u003c/em\u003e, the first value within the ordered set of aggregated argument values whose position in the ordering equals or exceeds the specified \u003cem class=\"parameter\"\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e. The aggregated argument must be of a sortable type.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epercentile_disc\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efraction\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003edouble precision\u003c/code\u003e ) \u003ccode class=\"literal\"\u003eWITHIN GROUP\u003c/code\u003e ( \u003ccode class=\"literal\"\u003eORDER BY\u003c/code\u003e \u003ccode class=\"type\"\u003eanyelement\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003eanyelement\u003c/code\u003e","returns":"anyelement","text":"percentile_disc ( fraction double precision ) WITHIN GROUP ( ORDER BY anyelement ) → anyelement","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"15159d4507df30ff765ad62f5fa04a440c29151cdcf33f9ea8da24480b99892d","Text":"percentile_disc ( fractions double precision[] ) WITHIN GROUP ( ORDER BY anyelement ) → anyarray","Returns":"anyarray","Payload":{"description":"Computes multiple discrete percentiles. The result is an array of the same dimensions as the fractions parameter, with each non-null element replaced by the input value corresponding to that percentile. The aggregated argument must be of a sortable type.","description_html":"Computes multiple discrete percentiles. The result is an array of the same dimensions as the \u003cem class=\"parameter\"\u003e\u003ccode\u003efractions\u003c/code\u003e\u003c/em\u003e parameter, with each non-null element replaced by the input value corresponding to that percentile. The aggregated argument must be of a sortable type.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epercentile_disc\u003c/code\u003e ( \u003cem class=\"parameter\"\u003e\u003ccode\u003efractions\u003c/code\u003e\u003c/em\u003e \u003ccode class=\"type\"\u003edouble precision[]\u003c/code\u003e ) \u003ccode class=\"literal\"\u003eWITHIN GROUP\u003c/code\u003e ( \u003ccode class=\"literal\"\u003eORDER BY\u003c/code\u003e \u003ccode class=\"type\"\u003eanyelement\u003c/code\u003e ) → \u003ccode class=\"returnvalue\"\u003eanyarray\u003c/code\u003e","returns":"anyarray","text":"percentile_disc ( fractions double precision[] ) WITHIN GROUP ( ORDER BY anyelement ) → anyarray","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
