mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-02 12:32:04 +00:00
20 lines
384 B
SQL
20 lines
384 B
SQL
-- https://github.com/ClickHouse/ClickHouse/issues/36189
|
|
SET allow_experimental_analyzer=1;
|
|
CREATE TABLE test
|
|
(
|
|
`dt` Date,
|
|
`text` String
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY dt;
|
|
|
|
insert into test values ('2020-01-01', 'text1'), ('2019-01-01', 'text2'), ('1900-01-01', 'text3');
|
|
|
|
WITH max(dt) AS maxDt
|
|
SELECT maxDt
|
|
FROM test;
|
|
|
|
WITH max(number) AS maxDt
|
|
SELECT maxDt
|
|
FROM numbers(10);
|