2023-12-13 12:14:00 +00:00
|
|
|
-- https://github.com/ClickHouse/ClickHouse/issues/46628
|
|
|
|
DROP TABLE IF EXISTS t;
|
|
|
|
CREATE TABLE t
|
|
|
|
(
|
2023-12-28 12:22:30 +00:00
|
|
|
`n` int,
|
2023-12-28 14:08:14 +00:00
|
|
|
`__unused_group_by_column` int
|
2023-12-13 12:14:00 +00:00
|
|
|
)
|
2023-12-28 12:22:30 +00:00
|
|
|
ENGINE = MergeTree
|
|
|
|
ORDER BY n AS
|
|
|
|
SELECT number, number
|
2023-12-13 12:14:00 +00:00
|
|
|
FROM numbers(10);
|
|
|
|
|
|
|
|
SELECT
|
|
|
|
sum(n),
|
2023-12-28 12:22:30 +00:00
|
|
|
__unused_group_by_column
|
2023-12-13 12:14:00 +00:00
|
|
|
FROM t
|
2023-12-28 14:08:14 +00:00
|
|
|
GROUP BY __unused_group_by_column ORDER BY __unused_group_by_column;
|
|
|
|
|
|
|
|
SELECT sum(n), 1 as x from t group by x;
|
2023-12-13 12:14:00 +00:00
|
|
|
|
|
|
|
SELECT
|
|
|
|
'processed' AS type,
|
|
|
|
max(number) AS max_date,
|
|
|
|
min(number) AS min_date
|
|
|
|
FROM numbers(100)
|
|
|
|
GROUP BY type;
|