2016-04-25 35 views
2

我想要一個查詢從德爾比表中獲取數據,其中時間值小於兩小時到當前時間。下面的查詢會與錯誤說如何從延遲的時間戳列中查詢數據。

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 

任何並欣賞幫助

+1

見相關:HTTP://計算器的.com /一個/193453分之12138416 –

回答

2

下面是答案,

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