ClickHouse/tests/queries/0_stateless/02510_group_by_prewhere_null.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
448 B
MySQL
Raw Normal View History

2022-12-19 05:49:42 +00:00
DROP TABLE IF EXISTS table1;
create table table1 (
col1 Int32,
col2 Int32
)
ENGINE = MergeTree
partition by tuple()
order by col1;
INSERT INTO table1 VALUES (1, 2), (1, 4);
with NULL as pid
select a.col1, sum(a.col2) as summ
from table1 a
prewhere (pid is null or a.col2 = pid)
group by a.col1;
with 123 as pid
select a.col1, sum(a.col2) as summ
from table1 a
prewhere (pid is null or a.col2 = pid)
group by a.col1;
DROP TABLE table1;