ClickHouse/tests/queries/0_stateless/02165_replicated_grouping_sets.sql

46 lines
733 B
MySQL
Raw Normal View History

2022-05-05 13:56:16 +00:00
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;