【发布时间】:2018-01-07 04:08:45
【问题描述】:
我正在尝试将时间戳列转换或转换为 Redshift 数据库中的整数值。我知道这在其他基于 SQL 的数据库中是可能的,而且我以前也这样做过,但是在 Redshift 中我无法让它工作。
我尝试了cast 和convert (http://docs.aws.amazon.com/redshift/latest/dg/r_CAST_function.html) 的一些变体。
这是一个例子:
SELECT cast(finish_time as integer) FROM table;
它给了我错误信息:
SQL Error Invalid operation: cannot cast type timestamp without time zone to integer;
是否可以获取整数形式的时间戳?
【问题讨论】:
标签: sql database time casting amazon-redshift