2018-10-24 11:31:23 +00:00
|
|
|
SET compile_expressions = 1;
|
2019-02-11 14:36:54 +00:00
|
|
|
SET min_count_to_compile_expression = 1;
|
2018-10-24 11:31:23 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS time_table;
|
2018-10-24 11:31:23 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
CREATE TABLE time_table(timecol DateTime, value Int32) ENGINE = MergeTree order by tuple();
|
2018-10-24 11:31:23 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO time_table VALUES (now() - 5, 5), (now() - 3, 3);
|
2018-10-24 11:31:23 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT COUNT() from time_table WHERE value < now() - 1 AND value != 0 AND modulo(value, 2) != 0 AND timecol < now() - 1;
|
2018-10-24 11:31:23 +00:00
|
|
|
|
|
|
|
SELECT sleep(3);
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO time_table VALUES (now(), 101);
|
2018-10-24 11:31:23 +00:00
|
|
|
|
|
|
|
SELECT sleep(3);
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT COUNT() from time_table WHERE value < now() - 1 AND value != 0 AND modulo(value, 2) != 0 AND timecol < now() - 1;
|
2018-10-24 11:31:23 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS time_table;
|