--两个时间相减得到的结果是天,如果要取小时则将结果集乘24,取分再乘60,取秒再乘60.....
select to_date('2016-01-05 18:30:00','yyyy-mm-dd hh:24:mi') - to_date('2016-01-05 10:30:00','yyyy-mm-dd hh:24:mi') from dual;
select (to_date('2016-01-05 11:30:20','yyyy-mm-dd hh:24:mi') - to_date('2016-01-05 10:30:00','yyyy-mm-dd hh:24:mi'))*24*60*60 from dual;