ClickHouse/dbms/tests/queries/0_stateless/00712_prewhere_with_alias_bug.sql
2018-09-06 12:46:23 +03:00

6 lines
325 B
SQL

drop table if exists test.prewhere_alias;
create table test.prewhere_alias (a Int32, b Int32, c alias a + b) engine = MergeTree order by b;
insert into test.prewhere_alias values(1, 1);
select a, c + toInt32(1), (c + toInt32(1)) * 2 from test.prewhere_alias prewhere (c + toInt32(1)) * 2 = 6;
drop table test.prewhere_alias;