我将日期作为'2018-01-02 12:12:22'形式的字符串字段,在ClickHouse SQL中将其转换为long int时间戳的正确方法是什么?

最佳答案

:) SELECT toUInt64(toDateTime('2018-01-02 12:12:22'));

SELECT toUInt64(toDateTime('2018-01-02 12:12:22'))

┌─toUInt64(toDateTime('2018-01-02 12:12:22'))─┐
│                                  1514884342 │
└─────────────────────────────────────────────┘

1 rows in set. Elapsed: 0.001 sec.

关于sql - Clickhouse:如何将日期转换为长整数?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52356995/

10-12 00:13
查看更多