想要取所有5天前的记录,在SQL Server里可以用DateAdd函数,Oracle里不知道用什么?

解决方案 »

  1.   

    select * from 表A where field >= to_date(sysdate - 5,'yyyy-mm-dd') 
    and field <= to_date(sysdate,'yyyy-mm-dd')
      

  2.   

    select   *   from   表A   where   field   > =   to_date(sysdate   -   5,'yyyy-MM-dd')   
    and   field   <=   to_date(sysdate,'yyyy-MM-dd')
      

  3.   

    select *   from   表A  where  field  >sysdate  - 5 and  field  <= sysdate