我必须从Oracle Table获取数据,其中我有一个日期字段被调用lastupdatedDate,我想只返回那些lastupdatedDate在最后10分钟内的行sysdate
例如,如果在我的表我lastupdateDate的 05/20/09 4:20:44 话,我想此行早在我的结果,如果我之间运行查询05/20/09 4:20:44和05/20/09 4:30:44,而不是如果,如果我跑的查询05/20/09 5:31:44.
Rob*_*ijk 72
或者稍微更具可读性:
select *
from mytable
where lastupdatedDate > sysdate - interval '10' minute
Run Code Online (Sandbox Code Playgroud)
Red*_*ter 25
select *
from mytable
where lastupdatedDate > sysdate - (10/1440)
Run Code Online (Sandbox Code Playgroud)
cur*_*isk 11
select sysdate - 10/(24*60) from dual;
Run Code Online (Sandbox Code Playgroud)
请参阅上面的示例以获取sysdate减去十分钟,现在只需添加到您的查询中
| 归档时间: |
|
| 查看次数: |
83015 次 |
| 最近记录: |