ClickHouse/tests/queries/1_stateful/00178_query_datetime64_index.sql
Lucas Chang 93415789d7 format
2023-05-28 10:42:42 +08:00

10 lines
400 B
SQL

DROP TABLE IF EXISTS datetime64_index_tbl;
CREATE TABLE datetime64_index_tbl(ts DateTime64(3, 'UTC')) ENGINE=MergeTree ORDER BY ts;
INSERT INTO datetime64_index_tbl(ts) VALUES(toDateTime64('2023-05-27 00:00:00', 3, 'UTC'));
SELECT ts FROM datetime64_index_tbl WHERE ts < toDate('2023-05-28');
SELECT ts FROM datetime64_index_tbl WHERE ts < toDate32('2023-05-28');
DROP TABLE datetime64_index_tbl;