日期:2014-05-20  浏览次数:20594 次

求一关于时间的sql语句~~~~~有点诡异,嘿嘿!望指教!
一个sql语句,能否查询查   一段时间内的一段时间的数据。
比如:查询   30天内每天晚上10点到早上6点的数据   ?
请大家指教啊   谢谢了!

------解决方案--------------------
你不说你的表结构么?
------解决方案--------------------
select A.number from A where A.time > = ADD_MONTHS(sysdate, -1)
and (to_char(A.time, 'hh24 ')> = '20 ' or to_char(A.time, 'hh24 ') < '06 ')