{"Entry":{"collection":"func","key":"percent-rank","name":"percent_rank","aliases":[],"metadata":{"changed_in":["9.4"],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"8.3","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"8.4"},{"descriptions_changed":true,"doc_overhaul":false,"from":"9.3","group_changed":{"from":"window","to":"aggregate"},"signatures":{"added":["percent_rank ( args ) WITHIN GROUP (ORDER BY sorted_args) → double precision"],"removed":[]},"status":"changed","to":"9.4"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"307bd5a21c9d60031ffb835402b11f5959b7f12be9295b5682c3c5532f0e2ce0","first_version":"8.4","group":"aggregate","group_label":"Aggregate Functions","groups":["aggregate","window"],"imported_at":"2026-09-27T17:57:28.935845+08:00","last_version":"20","name":"percent_rank","name_key":"percent_rank","position":21033,"present_in":["8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"signature":"percent_rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → double precision","signature_count":2,"slug":"percent-rank","source_rev":"b7bd9cda","summary":"Computes the relative rank of the hypothetical row, that is (rank - 1) / (total rows - 1).","summary_zh":""}},"Definition":{"Collection":"func","Key":"percent-rank","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"percent-rank","SourceRevision":"b7bd9cda","Facts":{"description":"Computes the relative rank of the hypothetical row, that is (rank - 1) / (total rows - 1). The value thus ranges from 0 to 1 inclusive.","description_html":"Computes the relative rank of the hypothetical row, that is (\u003ccode class=\"function\"\u003erank\u003c/code\u003e - 1) / (total rows - 1). The value thus ranges from 0 to 1 inclusive.","description_zh":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-HYPOTHETICAL-TABLE","file":"functions-aggregate.html","slug":"18"},"group":"aggregate","group_label":"Aggregate Functions","lang":"en","layout":"table-new","pages":["functions-aggregate.html","functions-window.html"],"prose_only":false,"signatures":[{"description":"Computes the relative rank of the hypothetical row, that is (rank - 1) / (total rows - 1). The value thus ranges from 0 to 1 inclusive.","description_html":"Computes the relative rank of the hypothetical row, that is (\u003ccode class=\"function\"\u003erank\u003c/code\u003e - 1) / (total rows - 1). The value thus ranges from 0 to 1 inclusive.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epercent_rank\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eargs\u003c/code\u003e\u003c/em\u003e ) \u003ccode class=\"literal\"\u003eWITHIN GROUP\u003c/code\u003e ( \u003ccode class=\"literal\"\u003eORDER BY\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esorted_args\u003c/code\u003e\u003c/em\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"percent_rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → double precision","zh_from":""},{"description":"Returns the relative rank of the current row, that is (rank - 1) / (total partition rows - 1). The value thus ranges from 0 to 1 inclusive.","description_html":"Returns the relative rank of the current row, that is (\u003ccode class=\"function\"\u003erank\u003c/code\u003e - 1) / (total partition rows - 1). The value thus ranges from 0 to 1 inclusive.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epercent_rank\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"percent_rank () → double precision","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-HYPOTHETICAL-TABLE","file":"functions-aggregate.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"percent-rank","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"percent_rank","Summary":"计算假设行的相对排名，即（rank - 1）/（总行数 - 1）。取值范围为 0 到 1（含）。","BodyHTML":"计算假设行的相对排名，即（\u003ccode\u003erank\u003c/code\u003e - 1）/（总行数 - 1）。取值范围为 0 到 1（含）。\u003cpre\u003epercent_rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → double precision\u003c/pre\u003e计算假设行的相对排名，即（\u003ccode\u003erank\u003c/code\u003e - 1）/（总行数 - 1）。取值范围为 0 到 1（含）。\u003cpre\u003epercent_rank () → double precision\u003c/pre\u003e返回当前行的相对排名，即(\u003ccode\u003erank\u003c/code\u003e - 1) / (总的分区行数 - 1)。因此，该值的范围从0到1（包含在内）。","SourceRevision":"1b5ca64c","ContentHash":"f480fdc62eb48cdde26ba4241830951b8ec454d3bffc849825a31d5a510876d6","Payload":{"description_zh":"计算假设行的相对排名，即（rank - 1）/（总行数 - 1）。取值范围为 0 到 1（含）。","description_zh_html":"计算假设行的相对排名，即（\u003ccode class=\"function\"\u003erank\u003c/code\u003e - 1）/（总行数 - 1）。取值范围为 0 到 1（含）。","signatures":[{"description_zh":"计算假设行的相对排名，即（rank - 1）/（总行数 - 1）。取值范围为 0 到 1（含）。","description_zh_html":"计算假设行的相对排名，即（\u003ccode class=\"function\"\u003erank\u003c/code\u003e - 1）/（总行数 - 1）。取值范围为 0 到 1（含）。","returns":"double precision","text":"percent_rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → double precision","zh_from":"doc"},{"description_zh":"返回当前行的相对排名，即(rank - 1) / (总的分区行数 - 1)。因此，该值的范围从0到1（包含在内）。","description_zh_html":"返回当前行的相对排名，即(\u003ccode class=\"function\"\u003erank\u003c/code\u003e - 1) / (总的分区行数 - 1)。因此，该值的范围从0到1（包含在内）。","returns":"double precision","text":"percent_rank () → double precision","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"c0a9af04461c5024a9b28405b4391b21847d51e6a1684bfbaf10b90252201b73","Text":"percent_rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → double precision","Returns":"double precision","Payload":{"description":"Computes the relative rank of the hypothetical row, that is (rank - 1) / (total rows - 1). The value thus ranges from 0 to 1 inclusive.","description_html":"Computes the relative rank of the hypothetical row, that is (\u003ccode class=\"function\"\u003erank\u003c/code\u003e - 1) / (total rows - 1). The value thus ranges from 0 to 1 inclusive.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epercent_rank\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003eargs\u003c/code\u003e\u003c/em\u003e ) \u003ccode class=\"literal\"\u003eWITHIN GROUP\u003c/code\u003e ( \u003ccode class=\"literal\"\u003eORDER BY\u003c/code\u003e \u003cem class=\"replaceable\"\u003e\u003ccode\u003esorted_args\u003c/code\u003e\u003c/em\u003e ) → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"percent_rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → double precision","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"4691e492fa0953f1615d514454e338f6b027bd1a88d8da46559d4721fb209bac","Text":"percent_rank () → double precision","Returns":"double precision","Payload":{"description":"Returns the relative rank of the current row, that is (rank - 1) / (total partition rows - 1). The value thus ranges from 0 to 1 inclusive.","description_html":"Returns the relative rank of the current row, that is (\u003ccode class=\"function\"\u003erank\u003c/code\u003e - 1) / (total partition rows - 1). The value thus ranges from 0 to 1 inclusive.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003epercent_rank\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003edouble precision\u003c/code\u003e","returns":"double precision","text":"percent_rank () → double precision","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
