use*_*376 3 sql amazon-redshift
我正在使用Redshift,并希望从时间戳中提取时间。
这是时间戳记:2017-10-31 23:30:00
我想把时间定为23:30:00
我尝试使用,cast(the_timestamp_column as time)但遇到以下错误消息:
error message: Function ""time"(timestamp without time zone)" not supported.
to_char与适当的格式掩码一起使用,以提取时间戳记的时间部分:
select to_char(the_timestamp_column, 'HH24:MI:SS')
from your_table;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5032 次 |
| 最近记录: |