oracle 10g 中怎样得到当期时间的前三天的年月日和当期时间的年月日?
然后再进行比较,谢谢!

解决方案 »

  1.   

    select to_char(sysdate-3,'yyyymmdd') from dual
      

  2.   

    where w.warntime between to_date('2010-07-03','yyyy-mm-dd') and to_date('2010-07-06','yyyy-mm-dd');    就是将里面的日期改为前三天及当期
      

  3.   

    把3天前的时间和当前日期to_char 然后进行比较。sysdate会精确到秒 你要的是日。
      

  4.   

    where w.warntime between sysdate-interval '3' day and sysdate
      

  5.   

    我一直用如下的方法。楼主可试试
    where trunc(w.warntime,'dd') > trunc(sysdate-3,'dd')
      

  6.   

    Select  trunc(sysdate-3) ,trunc(Sysdate)From dual;