CREATE_TIME为table表data数据类型的字段,以下为查询小于当前系统时间300秒的时刻后的记录
select * from table where CREATE_TIME> (select sysdate - 300/(24*60*60) from dual)
或
select * from table where CREATE_TIME> sysdate - 300/(24*60*60)
以下为查询2009-02-04 21:17:00后的记录
select * from table where CREATE_TIME> to_date('2009-02-04 21:17:00','yyyy-mm-dd hh24:mi:ss')
select * from table where CREATE_TIME> (select sysdate - 300/(24*60*60) from dual)
或
select * from table where CREATE_TIME> sysdate - 300/(24*60*60)
以下为查询2009-02-04 21:17:00后的记录
select * from table where CREATE_TIME> to_date('2009-02-04 21:17:00','yyyy-mm-dd hh24:mi:ss')
SQL时间查询技巧
本文介绍了如何使用SQL查询特定时间范围内的记录,包括基于当前系统时间和指定具体日期两种情况下的查询方法。
3064

被折叠的 条评论
为什么被折叠?



