【发布时间】:2015-07-15 08:32:15
【问题描述】:
我在 postgresql 中有数据类型为 time 而没有时区的列。所以我想将此列中的时间存储与字符串“03:15:00”匹配 我已经写完了。查询
select * from table1
where to_timestamp(timecol)::timestamp without time zone
= to_timestamp('03:15:00')::timestamp;
这里数据类型为time的列名是'timecol'
谁能告诉我如何匹配上述字段。
【问题讨论】:
-
改写您的问题:我如何找到
timecol中时间部分为'03:15:00'的所有行,完全忽略日期部分?
标签: postgresql