日期:2014-05-16  浏览次数:20512 次

Oracle获取两个日期之间的时间列表

?

select to_date('2009-08-01 10:00:00','yyyy-mm-dd hh24:mi:ss') + (rownum - 1)/24

from dual

connect by rownum<=

(

trunc(to_date('2009-08-01 12:00:00','yyyy-mm-dd hh24:mi:ss'), 'hh24')

-

trunc(to_date('2009-08-01 10:00:00','yyyy-mm-dd hh24:mi:ss'), 'hh24')

)*24 + 1