mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-06 06:22:39 +00:00
19 lines
488 B
SQL
19 lines
488 B
SQL
-- https://github.com/ClickHouse/ClickHouse/issues/17319
|
|
SET allow_experimental_analyzer=1;
|
|
CREATE TEMPORARY TABLE hits (date Date, data Float64) engine=Memory();
|
|
|
|
SELECT
|
|
subquery1.period AS period,
|
|
if(1=1, 0, subquery1.data1) AS data,
|
|
if(1=1, 0, subquery2.data) AS other_data
|
|
FROM
|
|
(
|
|
SELECT date AS period, data AS data1
|
|
FROM hits
|
|
) AS subquery1
|
|
LEFT JOIN
|
|
(
|
|
SELECT date AS period, data AS data
|
|
FROM hits
|
|
) AS subquery2 ON (subquery1.period = subquery2.period)
|