【问题标题】:How to query data from timestamp column with delay.?如何延迟查询时间戳列中的数据。?
【发布时间】:2016-08-18 14:23:41
【问题描述】:

我想要一个查询从 derby 表中获取数据,其中时间戳的时间值距当前时间不到两小时。以下查询给出错误提示

operator with a left operand type of 'TIMESTAMP' and a right operand type of 'INTEGER' is not supported.

查询:

select * from NEWS WHERE NEWS_DATE < current_timestamp-2

感谢任何帮助

【问题讨论】:

标签: derby


【解决方案1】:

这就是答案,

select *from NEWS where {fn TIMESTAMPDIFF( SQL_TSI_MINUTE, NEWS_DATE,current_timestamp)} <120

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-04
    • 1970-01-01
    • 2014-05-07
    • 2013-05-06
    相关资源
    最近更新 更多