【发布时间】:2019-10-28 04:14:56
【问题描述】:
如何在查询中选择1小时的时间范围?
SQL
select * from
history
where
clock == current_timestamp - interval '01:00:00'::timestamp;
带有函数的数据 to_timestamp
28689 2019-10-26 21:02:09 83.6353
28689 2019-10-26 21:01:39 83.6614
28689 2019-10-26 21:01:09 82.9015
28689 2019-10-26 21:00:39 82.9039
输出
输入语法无效
所需的输出是一个选择,其中作为时间戳的clock 列在输入值的一小时范围内。
【问题讨论】:
-
这是以前的答案,可能会有所帮助。 stackoverflow.com/questions/12425853/…
-
非常感谢您的帮助,我去看看!
标签: database postgresql