【发布时间】:2014-09-08 08:18:09
【问题描述】:
假设用户尝试将数字(出生年份)转换为日期。
select year_of_birth, cast(year_of_birth as date) from visit_occurrence
并得到这个错误:
cannot cast type smallint to date
正确的方法是什么? 例如, cast(cast(YOB as string)+'-01-01' as date) 也不起作用。
【问题讨论】:
标签: postgresql amazon-redshift