select trunc(date1-date2) from tbname;

解决方案 »

  1.   

    select trunc(sysdate-pushbegintime),sysdate,pushbegintime from adms_pushpolicy ;
    result:
    0     2004-3-29 9:54:45    2004-3-30
    -1    2004-3-29 9:54:45    2004-3-31
    0     2004-3-29 9:54:45    2004-3-30结果不对呀
      

  2.   

    select to_date(to_char(sysdate,'yyyy-mm-dd'),'yyyy-mm-dd')-to_date('2004-03-28','yyyy-mm-dd') from dual
      

  3.   

    用pl/sql提供的日期函数days_between
      

  4.   

    to drabit(square),有days_between()这个函数吗?我除了知道有month_between(),还真的没有见过,测试也没有通过