trunc(date1-date2)
直接相减就是天数。

解决方案 »

  1.   

    如果是规范的日期格式,则用trunc(date1-date2)搞定
      

  2.   

    soryy 工作日是指去除周末的天数
      

  3.   

    现在有了节假日表(不包括周末)一句sql能实现吗必须用存储过程吗?
      

  4.   

    现在有了节假日表、周末表
    如果需要可以将它们合并
    如果需要还可以建所有的日期表一句sql能取出工作日吗?
      

  5.   

    table1(date,flag)
    ------------------
    select trunc(date2-date1)-
    (select count(*) from table1 where (flag='周末' or flag='节假日')
    and data between date1 and date2 )
    from dual;