三天前的记录: select * from 表名 where (sysdate-日期字段-3)*1440 between -10 and 10三天后的记录: select * from 表名 where (sysdate-日期字段+3)*1440 between -10 and 10
select * from tb where dDate between sysdate+3-10/(60*24) and sysdate+3+10/(60*24)说明: sysdate 当前时间,取决于数据库机器的系统时间 +3 3天后 -10/(60*24) 10就是10分钟,60*24 就是一天24个小时,每个小时60分钟
where (sysdate-日期字段)*1440 between (3*1440-10) and (3*1440+10)
where 日期字段 between sysdate-3-10/(24*60) and sysdate-3+10/(24*60)
select * from 表名 where (sysdate-日期字段-3)*1440 between -10 and 10三天后的记录:
select * from 表名 where (sysdate-日期字段+3)*1440 between -10 and 10
sysdate 当前时间,取决于数据库机器的系统时间
+3 3天后
-10/(60*24) 10就是10分钟,60*24 就是一天24个小时,每个小时60分钟