{"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","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"],"signature":"GROUPING ( group_by_expression(s) ) → integer","signature_count":1,"slug":"grouping","source_rev":"2026-09-14T13:14:25.684213+00:00@99e6866c","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":"2026-09-14T13:14:25.684213+00:00@99e6866c","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":"","description_zh_html":"","doc":{"anchor":"FUNCTIONS-GROUPING-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":"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":"","description_zh_html":"","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":""}],"zh_from":""},"ManualEvidence":{"doc":{"anchor":"FUNCTIONS-GROUPING-TABLE","file":"functions-aggregate.html","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"func","Key":"grouping","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"GROUPING","Summary":"返回一个位掩码，指示哪些GROUP BY表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","BodyHTML":"返回一个位掩码，指示哪些\u003ccode\u003eGROUP BY\u003c/code\u003e表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。\u003cpre\u003eGROUPING ( group_by_expression(s) ) → integer\u003c/pre\u003e返回一个位掩码，指示哪些\u003ccode\u003eGROUP BY\u003c/code\u003e表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","SourceRevision":"ca936764","ContentHash":"bdde291e3df9c70b4946c39bd86457977d5015aede47e49cf33c69f4e58b45e1","Payload":{"description_zh":"返回一个位掩码，指示哪些GROUP BY表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","description_zh_html":"返回一个位掩码，指示哪些\u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","signatures":[{"description_zh":"返回一个位掩码，指示哪些GROUP BY表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","description_zh_html":"返回一个位掩码，指示哪些\u003ccode class=\"literal\"\u003eGROUP BY\u003c/code\u003e表达式未包含在当前分组集中。分配比特位时，最右侧参数对应最低有效位；如果相应表达式包含在生成当前结果行的分组集的分组条件中，该位为 0，否则为 1。","returns":"integer","text":"GROUPING ( group_by_expression(s) ) → integer","zh_from":"doc"}],"zh_from":"doc"}},"RequestedLocale":"zh-Hans","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":"","description_zh_html":"","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":""}}],"Spellings":null,"SQLState":null,"Evidence":null}
