【发布时间】:2017-07-20 04:11:24
【问题描述】:
我有一个2017-07-19 11:45:01的时间戳,我希望它转换为int。
查询:
select cast(max(event_timestamp) as INT) from error_messages where error_level='ERROR' and user_name='git'
错误:
SQL Error [2366] [42846]: [Vertica][VJDBC](2366) ERROR: Cannot cast type timestamptz to int
[Vertica][VJDBC](2366) ERROR: Cannot cast type timestamptz to int
com.vertica.util.ServerException: [Vertica][VJDBC](2366) ERROR: Cannot cast type timestamptz to int
【问题讨论】:
-
@Swat 使用 Vertica 中的 JULIAN_DAY 函数将时间戳转换为整数值或大整数。
-
谢谢@RohitPadma
-
@Swat 欢迎您! :)