Date32
一个日期。支持与 DateTime64 相同的日期范围。存储为本机字节顺序的有符号 32 位整数,值表示自 1970-01-01 以来的天数(0 表示 1970-01-01,负值表示 1970 年之前的日期)。
示例
创建一个带有 Date32
类型列的表并将数据插入其中
CREATE TABLE dt32
(
`timestamp` Date32,
`event_id` UInt8
)
ENGINE = TinyLog;
-- Parse Date
-- - from string,
-- - from 'small' integer interpreted as number of days since 1970-01-01, and
-- - from 'big' integer interpreted as number of seconds since 1970-01-01.
INSERT INTO dt32 VALUES ('2100-01-01', 1), (47482, 2), (4102444800, 3);
SELECT * FROM dt32;
┌──timestamp─┬─event_id─┐
│ 2100-01-01 │ 1 │
│ 2100-01-01 │ 2 │
└────────────┴──────────┘
另请参阅