Oracle fetches data at a certain time (from what time of the week to what time in the morning)

Time:2020-9-22

 select count(*),t.Group_Fields from (
select t.* ,to_char(t.time,’HH24′) stime,to_char(t.time,’HH24mi’) fz,to_char(time,’d’) 
from A t
where time>=to_date(‘2019-12-01′,’yyyy-MM-dd’) and ghsj<=to_date(‘2019-12-31′,’yyyy-MM-dd’) and to_char(time,’d’)=’2′
) where stime in (’08’,’09’,’10’,’11’,’12’)  and fz>=0800 a 
group by T.Group_Fields

 

To_ Char (time,’d ‘) takes the current day of the week as the first day of each week

To_ Char (t.time, ‘hh24mi’) takes the hour of the current time

O_ Char (t.time, ‘hh24’) takes the hour of the current time