I want a query to get data from a derby table with the timestamp where time value is less than two hours to current time. following query gives and error saying
operator with a left operand type of 'TIMESTAMP' and a right operand type of 'INTEGER' is not supported.
Query:
select * from NEWS WHERE NEWS_DATE < current_timestamp-2
Appriciate any help
答案 0 :(得分:2)
以下是答案,
select *from NEWS where {fn TIMESTAMPDIFF( SQL_TSI_MINUTE, NEWS_DATE,current_timestamp)} <120