2023-03-08 15:56:13 +00:00
|
|
|
set optimize_group_by_function_keys=0;
|
2022-06-30 10:13:58 +00:00
|
|
|
-- { echoOn }
|
2022-06-27 18:42:26 +00:00
|
|
|
SELECT number, number % 2, sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY ROLLUP(number, number % 2)
|
2022-06-30 10:13:58 +00:00
|
|
|
ORDER BY (number, number % 2, val)
|
|
|
|
SETTINGS group_by_use_nulls=1;
|
|
|
|
|
|
|
|
SELECT number, number % 2, sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY ROLLUP(number, number % 2)
|
|
|
|
ORDER BY (number, number % 2, val)
|
|
|
|
SETTINGS group_by_use_nulls=0;
|
|
|
|
|
|
|
|
SELECT number, number % 2, sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY CUBE(number, number % 2)
|
|
|
|
ORDER BY (number, number % 2, val)
|
|
|
|
SETTINGS group_by_use_nulls=1;
|
|
|
|
|
|
|
|
SELECT number, number % 2, sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY CUBE(number, number % 2)
|
|
|
|
ORDER BY (number, number % 2, val)
|
|
|
|
SETTINGS group_by_use_nulls=0;
|
2022-06-30 15:14:26 +00:00
|
|
|
|
|
|
|
SELECT
|
|
|
|
number,
|
|
|
|
number % 2,
|
|
|
|
sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY
|
|
|
|
GROUPING SETS (
|
|
|
|
(number),
|
|
|
|
(number % 2)
|
|
|
|
)
|
|
|
|
ORDER BY (number, number % 2, val)
|
|
|
|
SETTINGS group_by_use_nulls = 1;
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
number,
|
|
|
|
number % 2,
|
|
|
|
sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY
|
|
|
|
GROUPING SETS (
|
|
|
|
(number),
|
|
|
|
(number % 2)
|
|
|
|
)
|
|
|
|
ORDER BY (number, number % 2, val)
|
|
|
|
SETTINGS group_by_use_nulls = 0;
|
2022-07-12 12:15:43 +00:00
|
|
|
|
|
|
|
SELECT number, number % 2, sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY ROLLUP(number, number % 2) WITH TOTALS
|
|
|
|
ORDER BY (number, number % 2, val)
|
|
|
|
SETTINGS group_by_use_nulls=1;
|
|
|
|
|
|
|
|
SELECT number, number % 2, sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY CUBE(number, number % 2) WITH TOTALS
|
|
|
|
ORDER BY (number, number % 2, val)
|
|
|
|
SETTINGS group_by_use_nulls=1;
|
2022-09-05 11:06:16 +00:00
|
|
|
|
|
|
|
SELECT
|
|
|
|
number,
|
|
|
|
number % 2,
|
|
|
|
sum(number) AS val
|
|
|
|
FROM numbers(10)
|
|
|
|
GROUP BY
|
|
|
|
GROUPING SETS (
|
|
|
|
(number),
|
|
|
|
(number % 2)
|
|
|
|
)
|
|
|
|
ORDER BY 1, tuple(val)
|
2022-09-05 11:09:07 +00:00
|
|
|
SETTINGS group_by_use_nulls = 1, max_bytes_before_external_sort=10;
|