mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-09 16:02:23 +00:00
44 lines
875 B
Plaintext
44 lines
875 B
Plaintext
-- { echoOn }
|
|
SELECT count() AS amount, a, b, GROUPING(a, b) FROM test02315 GROUP BY GROUPING SETS ((a, b), (a), ()) ORDER BY (amount, a, b) SETTINGS force_grouping_standard_compatibility=0;
|
|
1 0 0 3
|
|
1 0 2 3
|
|
1 0 4 3
|
|
1 0 6 3
|
|
1 0 8 3
|
|
1 1 1 3
|
|
1 1 3 3
|
|
1 1 5 3
|
|
1 1 7 3
|
|
1 1 9 3
|
|
5 0 0 2
|
|
5 1 0 2
|
|
10 0 0 0
|
|
SELECT count() AS amount, a, b, GROUPING(a, b) FROM test02315 GROUP BY ROLLUP(a, b) ORDER BY (amount, a, b) SETTINGS force_grouping_standard_compatibility=0;
|
|
1 0 0 3
|
|
1 0 2 3
|
|
1 0 4 3
|
|
1 0 6 3
|
|
1 0 8 3
|
|
1 1 1 3
|
|
1 1 3 3
|
|
1 1 5 3
|
|
1 1 7 3
|
|
1 1 9 3
|
|
5 0 0 2
|
|
5 1 0 2
|
|
10 0 0 0
|
|
SELECT count() AS amount, a, b, GROUPING(a, b) FROM test02315 GROUP BY GROUPING SETS ((a, b), (a, a), ()) ORDER BY (amount, a, b) SETTINGS force_grouping_standard_compatibility=0, allow_experimental_analyzer=1;
|
|
1 0 0 3
|
|
1 0 2 3
|
|
1 0 4 3
|
|
1 0 6 3
|
|
1 0 8 3
|
|
1 1 1 3
|
|
1 1 3 3
|
|
1 1 5 3
|
|
1 1 7 3
|
|
1 1 9 3
|
|
5 0 0 2
|
|
5 1 0 2
|
|
10 0 0 0
|