设需要找昨天的数据,表名为 a ,日期字段为 rq
select * from a where trunc(sysdate-1)=trunc(rq)
trunc 可以拿到时间的日期部分
具体你根据你的情况完善一下。
select ceil(to_date('2013-11-08 00:00:00','yyyy-mm-dd hh24:mi:ss')-to_date('2013-11-07 23:59:59','yyyy-mm-dd hh24:mi:ss')) from dual
用ceil,向上取整就好了嘛
select sysdate-日期 from dual;
#得到的是你的那个日期和当前时间相差多少天