mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-18 22:40:50 +00:00
42 lines
1.5 KiB
MySQL
42 lines
1.5 KiB
MySQL
|
drop table if exists tst;
|
||
|
create table tst (timestamp DateTime, val Nullable(Int8)) engine SummingMergeTree partition by toYYYYMM(timestamp) ORDER by (timestamp);
|
||
|
insert into tst values ('2018-02-01 00:00:00', 1), ('2018-02-02 00:00:00', 2);
|
||
|
|
||
|
select count() from tst;
|
||
|
select count() from tst final;
|
||
|
|
||
|
select count() from tst where timestamp is not null;
|
||
|
select count() from tst final where timestamp is not null;
|
||
|
|
||
|
select count() from tst where val is not null;
|
||
|
select count() from tst final where val is not null;
|
||
|
|
||
|
select count() from tst final where timestamp>0;
|
||
|
select count() from tst final prewhere timestamp > 0;
|
||
|
select count() from tst final where timestamp > '2017-01-01 00:00:00'
|
||
|
|
||
|
select count() from tst final where val>0;
|
||
|
select count() from tst final prewhere val>0;
|
||
|
|
||
|
drop table if exists tst;
|
||
|
create table tst (timestamp DateTime, val Int8) engine SummingMergeTree partition by toYYYYMM(timestamp) ORDER by (timestamp);
|
||
|
insert into tst values ('2018-02-01 00:00:00', 1), ('2018-02-02 00:00:00', 2);
|
||
|
|
||
|
select count() from tst;
|
||
|
select count() from tst final;
|
||
|
|
||
|
select count() from tst where timestamp is not null;
|
||
|
select count() from tst final where timestamp is not null;
|
||
|
|
||
|
select count() from tst where val is not null;
|
||
|
select count() from tst final where val is not null;
|
||
|
|
||
|
select count() from tst final where timestamp>0;
|
||
|
select count() from tst final prewhere timestamp > 0;
|
||
|
select count() from tst final where timestamp > '2017-01-01 00:00:00'
|
||
|
|
||
|
select count() from tst final where val>0;
|
||
|
select count() from tst final prewhere val>0;
|
||
|
|
||
|
drop table tst;
|