mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-19 21:03:51 +00:00
24 lines
357 B
SQL
24 lines
357 B
SQL
-- https://github.com/ClickHouse/ClickHouse/issues/46628
|
|
DROP TABLE IF EXISTS t;
|
|
CREATE TABLE t
|
|
(
|
|
`n` int
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY n AS
|
|
SELECT *
|
|
FROM numbers(10);
|
|
|
|
SELECT
|
|
sum(n),
|
|
1 AS x
|
|
FROM t
|
|
GROUP BY x;
|
|
|
|
SELECT
|
|
'processed' AS type,
|
|
max(number) AS max_date,
|
|
min(number) AS min_date
|
|
FROM numbers(100)
|
|
GROUP BY type;
|