mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 09:52:38 +00:00
31 lines
384 B
MySQL
31 lines
384 B
MySQL
|
DROP TABLE IF EXISTS x;
|
||
|
|
||
|
CREATE TABLE x ENGINE = Log AS SELECT * FROM numbers(0);
|
||
|
|
||
|
SYSTEM STOP MERGES x;
|
||
|
|
||
|
WITH y AS
|
||
|
(
|
||
|
SELECT *
|
||
|
FROM numbers(10)
|
||
|
)
|
||
|
INSERT INTO x
|
||
|
SELECT *
|
||
|
FROM y
|
||
|
INTERSECT
|
||
|
SELECT *
|
||
|
FROM numbers(5);
|
||
|
|
||
|
WITH y AS
|
||
|
(
|
||
|
SELECT *
|
||
|
FROM numbers(10)
|
||
|
)
|
||
|
INSERT INTO x
|
||
|
SELECT *
|
||
|
FROM numbers(5)
|
||
|
INTERSECT
|
||
|
SELECT *
|
||
|
FROM y;
|
||
|
|
||
|
SELECT * FROM x;
|