我正在尝试获取数据库中更新日期介于 systimestamp -15 分钟间隔到当前 systimestamp 之间的所有记录。
所以我要做的是:
and (CAST (update_date AS TIMESTAMP) at time zone 'UTC') BETWEEN (cast((systimestamp - interval '15' minute) at time zone 'UTC' as timestamp)) AND (cast((systimestamp) at time zone 'UTC' as timestamp))
如果我将它们分开用于特定记录:
(CAST (update_date AS TIMESTAMP) at time zone 'UTC') -> 26-APR-18 01.10.16.000000000 AM UTC
(cast((systimestamp - interval '15' minute) at time zone 'UTC' as timestamp)) -> 26-APR-18 12.57.04.136000000 AM
(cast((systimestamp) at time zone 'UTC' as timestamp)) -> 26-APR-18 01.12.04.136000000 AM
基本上第一个在另外两个之间,所以查询应该返回一条记录,但它没有。有什么帮助吗?