{"Entry":{"collection":"func","key":"rank","name":"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":["rank ( args ) WITHIN GROUP (ORDER BY sorted_args) → bigint"],"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":"02c7d49ecbd40ff5ed411c8ac23841fa089c71f8a2277ccf1e9ae76a552d08d5","first_version":"8.4","group":"aggregate","group_label":"Aggregate Functions","groups":["aggregate","window"],"imported_at":"2026-09-27T17:57:28.93856+08:00","last_version":"20","name":"rank","name_key":"rank","position":21038,"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":"rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → bigint","signature_count":2,"slug":"rank","source_rev":"b7bd9cda","summary":"Computes the rank of the hypothetical row, with gaps; that is, the row number of the first row in its peer group.","summary_zh":""}},"Definition":{"Collection":"func","Key":"rank","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"rank","SourceRevision":"b7bd9cda","Facts":{"description":"Computes the rank of the hypothetical row, with gaps; that is, the row number of the first row in its peer group.","description_html":"Computes the rank of the hypothetical row, with gaps; that is, the row number of the first row in its peer group.","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 rank of the hypothetical row, with gaps; that is, the row number of the first row in its peer group.","description_html":"Computes the rank of the hypothetical row, with gaps; that is, the row number of the first row in its peer group.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003erank\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\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → bigint","zh_from":""},{"description":"Returns the rank of the current row, with gaps; that is, the row_number of the first row in its peer group.","description_html":"Returns the rank of the current row, with gaps; that is, the \u003ccode class=\"function\"\u003erow_number\u003c/code\u003e of the first row in its peer group.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003erank\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"rank () → bigint","zh_from":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-HYPOTHETICAL-TABLE","file":"functions-aggregate.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"rank","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"rank","Summary":"计算假设行的排名，允许空缺；即该行所属同等行组中第一行的行号。","BodyHTML":"计算假设行的排名，允许空缺；即该行所属同等行组中第一行的行号。\u003cpre\u003erank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → bigint\u003c/pre\u003e计算假设行的排名，允许空缺；即该行所属同等行组中第一行的行号。\u003cpre\u003erank () → bigint\u003c/pre\u003e返回当前行的排名，允许空缺；即同等行组中第一行的\u003ccode\u003erow_number\u003c/code\u003e。","SourceRevision":"1b5ca64c","ContentHash":"27dc01549d7ec2185114daad8468e358452430b7679c8af0dbee4a5ad4988690","Payload":{"description_zh":"计算假设行的排名，允许空缺；即该行所属同等行组中第一行的行号。","description_zh_html":"计算假设行的排名，允许空缺；即该行所属同等行组中第一行的行号。","signatures":[{"description_zh":"计算假设行的排名，允许空缺；即该行所属同等行组中第一行的行号。","description_zh_html":"计算假设行的排名，允许空缺；即该行所属同等行组中第一行的行号。","returns":"bigint","text":"rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → bigint","zh_from":"doc"},{"description_zh":"返回当前行的排名，允许空缺；即同等行组中第一行的row_number。","description_zh_html":"返回当前行的排名，允许空缺；即同等行组中第一行的\u003ccode class=\"function\"\u003erow_number\u003c/code\u003e。","returns":"bigint","text":"rank () → bigint","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":"e33dc3f3f87cf5f568b228aa379aff60f8047ed3e5a4e77cf21d401461acd784","Text":"rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → bigint","Returns":"bigint","Payload":{"description":"Computes the rank of the hypothetical row, with gaps; that is, the row number of the first row in its peer group.","description_html":"Computes the rank of the hypothetical row, with gaps; that is, the row number of the first row in its peer group.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003erank\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\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"rank ( args ) WITHIN GROUP ( ORDER BY sorted_args ) → bigint","zh_from":""}},{"Version":"18","Ordinal":1,"Hash":"90171d6f06af9c637ae3fb916f7433dc9e091ccb1dfd0bbef570a609237cd3a4","Text":"rank () → bigint","Returns":"bigint","Payload":{"description":"Returns the rank of the current row, with gaps; that is, the row_number of the first row in its peer group.","description_html":"Returns the rank of the current row, with gaps; that is, the \u003ccode class=\"function\"\u003erow_number\u003c/code\u003e of the first row in its peer group.","description_zh":"","description_zh_html":"","examples":[],"html":"\u003ccode class=\"function\"\u003erank\u003c/code\u003e () → \u003ccode class=\"returnvalue\"\u003ebigint\u003c/code\u003e","returns":"bigint","text":"rank () → bigint","zh_from":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
