select (date1-date2)*1440 from dual;

解决方案 »

  1.   

    http://www.csdn.net/expert/topic/905/905232.xml?temp=.2481958
    这是计算秒的!
      

  2.   

    例子:
    select (to_date('2002-7-28 12:12:20','yyyy-mm-dd hh24:mi:ss')
    -to_date('2002-7-27 12:12:20','yyyy-mm-dd hh24:mi:ss'))*24*60 
    from dual
    *24得到时间之间的时种数
    *24×60得到时间之间的分种数
    *24×60×60得到时间之间的秒种数
      

  3.   

    前面讲的都对,只是由日期相减得出来的天,带有很多的小数点,即使是*24*60,还会有很多小数点,必须对小数点进行处理,否则有可能出现我浮点错误。一般我是用Trunc函数,直接去掉小数点。