【发布时间】:2012-11-28 12:59:16
【问题描述】:
在 PostgreSQL 中:我将 string 转换为 timestamp 和 to_timestamp():
select * from ms_secondaryhealthcarearea
where to_timestamp((COALESCE(update_datetime, '19900101010101'),'YYYYMMDDHH24MISS')
> to_timestamp('20121128191843','YYYYMMDDHH24MISS')
但我得到这个错误:
ERROR: syntax error at end of input
LINE 1: ...H24MISS') >to_timestamp('20121128191843','YYYYMMDDHH24MISS')
^
********** Error **********
ERROR: syntax error at end of input
SQL state: 42601
Character: 176
为什么?如何将string 转换为timestamp?
【问题讨论】:
标签: postgresql datetime database-design timestamp