mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Update docs/en/sql-reference/aggregate-functions/grouping_function.md
Co-authored-by: Dan Roscigno <dan@roscigno.com>
This commit is contained in:
parent
45d9bb5270
commit
23353c376f
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
[ROLLUP](../statements/select/group-by.md/#rollup-modifier) and [CUBE](../statements/select/group-by.md/#cube-modifier) are modifiers to GROUP BY. Both of these calculate subtotals. ROLLUP takes an ordered list of columns, for example `(day, month, year)`, and calculates subtotals at each level of the aggregation and then a grand total. CUBE calculates subtotals across all possible combinations of the columns specified. GROUPING identifies which rows returned by ROLLUP or CUBE are superaggregates, and which are rows that would be returned by an unmodified GROUP BY.
|
[ROLLUP](../statements/select/group-by.md/#rollup-modifier) and [CUBE](../statements/select/group-by.md/#cube-modifier) are modifiers to GROUP BY. Both of these calculate subtotals. ROLLUP takes an ordered list of columns, for example `(day, month, year)`, and calculates subtotals at each level of the aggregation and then a grand total. CUBE calculates subtotals across all possible combinations of the columns specified. GROUPING identifies which rows returned by ROLLUP or CUBE are superaggregates, and which are rows that would be returned by an unmodified GROUP BY.
|
||||||
|
|
||||||
The GROUPING function takes a column as an argument, and returns a 1 or a 0.
|
The GROUPING function takes multiple columns as an argument, and returns a bitmask.
|
||||||
- `1` indicates that a row returned by a `ROLLUP` or `CUBE` modifier to `GROUP BY` is a subtotal
|
- `1` indicates that a row returned by a `ROLLUP` or `CUBE` modifier to `GROUP BY` is a subtotal
|
||||||
- `0` indicates that a row returned by a `ROLLUP` or `CUBE` is a row that is not a subtotal
|
- `0` indicates that a row returned by a `ROLLUP` or `CUBE` is a row that is not a subtotal
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user