ClickHouse/tests/queries/0_stateless/03155_in_nested_subselects.sql
Yakov Olkhovskiy 0b07f2236c add test
2024-05-16 13:42:49 +00:00

20 lines
656 B
SQL

-- https://github.com/ClickHouse/ClickHouse/issues/63833
SET allow_experimental_analyzer = 1;
create table Example (id Int32) engine = MergeTree ORDER BY id;
INSERT INTO Example SELECT number AS id FROM numbers(2);
create table Null engine=Null as Example ;
--create table Null engine=MergeTree order by id as Example ;
create materialized view Transform to Example as
select * from Null
join ( select * FROM Example
WHERE id IN (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM (SELECT * FROM Null)))))
) as old
using id;
INSERT INTO Null SELECT number AS id FROM numbers(2);
select * from Example; -- should return 4 rows