运行
SELECT timestamp '2019-6-2 00:00 UTC'
将向我返回日期表示
然后我想以bigint的形式获取它,
SELECT cast(timestamp '2019-6-2 00:00 UTC' as bigint)
我收到此错误
Query failed (#20190604_014249_16755_mru2t): line 1:8: Cannot cast timestamp with time zone to bigint
答案 0 :(得分:4)
您想要什么bigint?一个合理的答案是unix时间戳:
select cast(to_unixtime(timestamp '2019-6-2 00:00 UTC') as bigint)