mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
22 lines
516 B
SQL
22 lines
516 B
SQL
CREATE TABLE datetime64_cmp
|
|
(
|
|
dt6 DateTime64(6, 'UTC'),
|
|
dt3 DateTime64(3, 'UTC')
|
|
) ENGINE = Memory;
|
|
|
|
INSERT INTO datetime64_cmp
|
|
VALUES ('2019-09-16 19:20:33.123000', '2019-09-16 19:20:33.123'), ('2019-09-16 19:20:33.123456', '2015-05-18 07:40:29.123'), ('2015-05-18 07:40:29.123456', '2019-09-16 19:20:33.123');
|
|
|
|
-- Compare equal and unequal values of different precicion/scale
|
|
SELECT
|
|
dt6, dt3,
|
|
dt6 > dt3,
|
|
dt6 >= dt3,
|
|
dt6 = dt3,
|
|
dt6 <= dt3,
|
|
dt6 < dt3,
|
|
dt6 != dt3
|
|
FROM datetime64_cmp
|
|
ORDER BY
|
|
dt6, dt3;
|