{"Entry":{"collection":"func","key":"grouping","name":"GROUPING","aliases":[],"metadata":{"changed_in":[],"changes":[{"descriptions_changed":false,"doc_overhaul":false,"from":"9.4","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"added","to":"9.5"},{"descriptions_changed":false,"doc_overhaul":true,"from":"12","group_changed":null,"signatures":{"added":[],"removed":[]},"status":"changed","to":"13"}],"content_hash":"d6d754885799711e560399ef95b13698fa645baeb997ec3fa3e723e8855b0a26","derived_content_hash":"c729b510d7bba96dfe8891156346bed5abc20b0e130bc24f213609c78e55dea3","documentation_refresh":{"batch":"20261113","original_source_rev":"wiki-repair-20261023:590d57972f6bf3c2cae466cfd85a83235dc6f900a94d47bb8b58aaf3cf1a58e6","versions":{"14":"14.25","15":"15.20","16":"16.16","17":"17.12","18":"18.7","19":"19rc2"}},"first_version":"9.5","group":"aggregate","group_label":"Aggregate Functions","groups":["aggregate"],"imported_at":"2026-09-14T21:49:48.852495+08:00","last_version":"20","name":"GROUPING","name_key":"grouping","position":21015,"present_in":["9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"repair_provenance":{"original_source_revision":"2026-09-14T13:14:25.684213+00:00@99e6866c","receipt_sha256":"1112bed67eec79b88559b222222648ef8c5139828fe45fc6aed7476e14cd8ca4","repair":"wiki-repair-20261023"},"signature":"GROUPING ( group_by_expression(s) ) → integer","signature_count":1,"slug":"grouping","source_rev":"wiki-repair-20261023:590d57972f6bf3c2cae466cfd85a83235dc6f900a94d47bb8b58aaf3cf1a58e6","summary":"Returns a bit mask indicating which GROUP BY expressions are not included in the current grouping set.","summary_zh":""}},"Definition":{"Collection":"func","Key":"grouping","SourceDatabase":"center","Version":"18","SourceTable":"func","SourceKey":"grouping","SourceRevision":"wiki-repair-20261023:590d57972f6bf3c2cae466cfd85a83235dc6f900a94d47bb8b58aaf3cf1a58e6","Facts":{"description":"Returns a bit mask indicating which GROUP BY expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_html":"Returns a bit mask indicating which \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_zh":"返回一个位掩码，指示哪些 GROUP BY 表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","description_zh_html":"返回一个位掩码，指示哪些 \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e 表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","doc":{"anchor":"FUNCTIONS-GROUPING-TABLE","file":"functions-aggregate.html","sha256":"31d3dcd36ef353484b4b3535f9f0d1cc239c3910146257fe5178f99b90b501e2","slug":"18"},"documentation_revision":{"inputs":[{"file":"functions-aggregate.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"31d3dcd36ef353484b4b3535f9f0d1cc239c3910146257fe5178f99b90b501e2","version":"18.7"},{"file":"functions-aggregate.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"0bf7506d27b71666fc74840a21a8f77c8a92735174f1d05033865961722e457c","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"},"group":"aggregate","group_label":"聚合函数","lang":"en","layout":"table-new","pages":["functions-aggregate.html"],"prose_only":false,"signatures":[{"description":"Returns a bit mask indicating which GROUP BY expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_html":"Returns a bit mask indicating which \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_zh":"返回一个位掩码，指示哪些 GROUP BY 表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","description_zh_html":"返回一个位掩码，指示哪些 \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e 表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","examples":[],"html":"\u003ccode class=\"function\"\u003eGROUPING\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003egroup_by_expression(s)\u003c/code\u003e\u003c/em\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"GROUPING ( group_by_expression(s) ) → integer","zh_from":"same-version-manual"}],"translation_provenance":{"inputs":[{"kind":"current-pgdoc-translation","path":"/Users/vonng/pgsty/pgdoc/zh/18/html/functions-aggregate.html","sha256":"68da7af09e2749a855188bbbff99ae036fc7eece4e19b8e048baffd28aa3ca59"}],"kind":"same-version-pgdoc","locale":"zh-Hans","source_revision":"b1b500221dbe5437cfca004d6b04d3f6e422765d","version":"18"},"zh_from":"same-version-manual"},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-GROUPING-TABLE","file":"functions-aggregate.html","sha256":"31d3dcd36ef353484b4b3535f9f0d1cc239c3910146257fe5178f99b90b501e2","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"grouping","SourceDatabase":"center","Version":"18","Locale":"en","Title":"GROUPING","Summary":"Returns a bit mask indicating which GROUP BY expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","BodyHTML":"Returns a bit mask indicating which \u003ccode\u003eGROUP BY\u003c/code\u003e expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","SourceRevision":"wiki-repair-20261023:590d57972f6bf3c2cae466cfd85a83235dc6f900a94d47bb8b58aaf3cf1a58e6","ContentHash":"28719d9e3b74521363723c87469d86c496315766b5a01a6f3261be9005eaa1db","Payload":{"description":"Returns a bit mask indicating which GROUP BY expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_html":"Returns a bit mask indicating which \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","signatures":[{"description":"Returns a bit mask indicating which GROUP BY expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_html":"Returns a bit mask indicating which \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_zh":"返回一个位掩码，指示哪些 GROUP BY 表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","description_zh_html":"返回一个位掩码，指示哪些 \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e 表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","examples":[],"html":"\u003ccode class=\"function\"\u003eGROUPING\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003egroup_by_expression(s)\u003c/code\u003e\u003c/em\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"GROUPING ( group_by_expression(s) ) → integer","zh_from":"same-version-manual"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":[{"Version":"18","Ordinal":0,"Hash":"2f2feefa696050fbffd8f00025084064551fb1e038a8bf83417fdaf2ae55140a","Text":"GROUPING ( group_by_expression(s) ) → integer","Returns":"integer","Payload":{"description":"Returns a bit mask indicating which GROUP BY expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_html":"Returns a bit mask indicating which \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e expressions are not included in the current grouping set. Bits are assigned with the rightmost argument corresponding to the least-significant bit; each bit is 0 if the corresponding expression is included in the grouping criteria of the grouping set generating the current result row, and 1 if it is not included.","description_zh":"返回一个位掩码，指示哪些 GROUP BY 表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","description_zh_html":"返回一个位掩码，指示哪些 \u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e 表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","examples":[],"html":"\u003ccode class=\"function\"\u003eGROUPING\u003c/code\u003e ( \u003cem class=\"replaceable\"\u003e\u003ccode\u003egroup_by_expression(s)\u003c/code\u003e\u003c/em\u003e ) → \u003ccode class=\"returnvalue\"\u003einteger\u003c/code\u003e","returns":"integer","text":"GROUPING ( group_by_expression(s) ) → integer","zh_from":"same-version-manual"}}],"Spellings":null,"SQLState":null,"Evidence":null}
