oracle sql查询语句寻求帮助

我想要查询一段时间内每天早八点到下午四点,下午四点到第二天早八点的数据,请问用sql怎么能写出来,感谢

先减去8小时,再取小时值和 08 (这是 16-8 得到的)比大小,就能划分两个区段了。

SELECT *
  FROM table1
 WHERE to_char(日期-8.0/24, 'hh24') < '08'

SELECT *
FROM table1
WHERE to_char(日期-8.0/24, 'hh24') < '08'

select  * from table1 where  to_number(SUBSTR(visit_time,12,2))>=8 and  to_number(SUBSTR(visit_time,12,2))<16

and SUBSTR(visit_time,0,10)>='2017-05-01' and SUBSTR(visit_time,0,10)<='2017-05-26'

SELECT *
FROM table1
WHERE to_char(日期-8.0/24, 'hh24') < '08'