ClickHouse/tests/queries/0_stateless/02165_replicated_grouping_sets.sql
Dmitry Novik 4cc26aa38b Merge remote-tracking branch 'origin/master' into grouping-sets-fix
And fix execution of the query with only one grouping set
2022-05-05 17:14:52 +00:00

46 lines
733 B
SQL

SELECT
k1,
k2,
SUM(number) AS sum_value,
count() AS count_value
FROM numbers(6)
GROUP BY
GROUPING SETS
(
(number % 2 AS k1),
(number % 3 AS k2)
)
ORDER BY
sum_value ASC,
count_value ASC;
SELECT
k1,
k2,
SUM(number) AS sum_value,
count() AS count_value
FROM remote('127.0.0.{2,3}', numbers(6))
GROUP BY
GROUPING SETS
(
(number % 2 AS k1),
(number % 3 AS k2)
)
ORDER BY
sum_value ASC,
count_value ASC;
SELECT
k2,
SUM(number) AS sum_value,
count() AS count_value
FROM remote('127.0.0.{2,3}', numbers(6))
GROUP BY
GROUPING SETS
(
(number % 3 AS k2)
)
ORDER BY
sum_value ASC,
count_value ASC;