mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-10 00:12:27 +00:00
233c6534e3
Signed-off-by: Duc Canh Le <duccanh.le@ahrefs.com>
29 lines
511 B
SQL
29 lines
511 B
SQL
DROP TABLE IF EXISTS t;
|
|
|
|
CREATE TABLE t
|
|
(
|
|
`key` Int64,
|
|
`someCol` String,
|
|
`eventTime` DateTime
|
|
)
|
|
ENGINE = ReplacingMergeTree(eventTime)
|
|
ORDER BY key;
|
|
|
|
INSERT INTO t Values (1, 'first', '2024-04-19 01:01:01');
|
|
INSERT INTO t Values (1, 'first', '2024-04-19 01:01:01');
|
|
|
|
SET allow_experimental_analyzer = 1;
|
|
|
|
EXPLAIN QUERY TREE passes=1
|
|
WITH merged_test AS(
|
|
SELECT * FROM t Final
|
|
)
|
|
SELECT * FROM merged_test;
|
|
|
|
WITH merged_test AS(
|
|
SELECT * FROM t Final
|
|
)
|
|
SELECT * FROM merged_test;
|
|
|
|
DROP TABLE t;
|