select mod(65,1) from dual; 返回 0
select to_number(to_date('2010/07/15 12','yyyy/mm/dd hh24') - to_date('2010/07/12 19','yyyy/mm/dd hh24'))*24  from dual; 返回 65select mod((to_number(to_date('2010/07/15 12','yyyy/mm/dd hh24') - to_date('2010/07/12 19','yyyy/mm/dd hh24'))*24),1)  from dual; 却返回 1  为什么?  期待高手...

解决方案 »

  1.   

    你试试这个等于几:
    select mod(to_number(to_date('2010/07/15 12','yyyy/mm/dd hh24') - to_date('2010/07/12 12','yyyy/mm/dd hh24'))*24 ,1)from dual;
      

  2.   

    下面这样就等于0了,可能是to_number方法和number数据类型做的怪。具体的得查下资料了。select mod(trunc(to_number(to_date('2010/07/15 12', 'yyyy/mm/dd hh24') -
                               to_date('2010/07/12 19', 'yyyy/mm/dd hh24')) * 24),
               1)
      from dual;