mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 14:02:21 +00:00
18 lines
388 B
SQL
18 lines
388 B
SQL
-- https://github.com/ClickHouse/ClickHouse/issues/29748
|
|
SET allow_experimental_analyzer=1;
|
|
|
|
create table events ( distinct_id String ) engine = Memory;
|
|
|
|
INSERT INTO events VALUES ('1234'), ('1');
|
|
|
|
WITH cte1 as (
|
|
SELECT '1234' as x
|
|
), cte2 as (
|
|
SELECT '1234' as x
|
|
)
|
|
SELECT *
|
|
FROM events AS events
|
|
JOIN cte2 ON cte2.x = events.distinct_id
|
|
JOIN cte1 ON cte1.x = cte2.x
|
|
limit 1;
|