日期:2014-05-17  浏览次数:20722 次

求教 这个SQL的意思
to_number((to_dateHTime,'yyyyMMdd hh24:mi:ss')-to_date(PTime,'yyyyMMdd hh24:mi:ss'))*24*60*60)

日期格式为20120321225001231

现在我需要的是比如 10:20到11:50这段时间内的 怎么写

------解决方案--------------------
如果你的时间列是date类型
to_char(时间列, 'HH24:MI') between '10:20' and '11:50'

如果你的时间列是字符串
substr(时间列, 9, 4) between '1020' and '1150'