sysdate 为现在时间
sysdate-1为昨天
trunc(sysdate-1)为昨天凌晨0:00
trunc(sysdate-1)+20/24 为昨天晚上8点
select trunc(sysdate-1)+20/24 from dual;
insert into personal
values(to_date(sysdate,'yyyy-MM-dd HH24:mi:ss'));
select (sysdate-1) ReadTime,2 orderstatus,count(t.info_id) productNumber,sysdate Createtime from rd_demand_wbk t
where t.createtime>= to_date(to_char((sysdate-1),'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd hh24:mi:ss')
and t.createtime<= to_date(to_char(trunc((sysdate-1)+23/24),'yyyy-MM-dd hh24:mi:ss'),'yyyy-MM-dd hh24:mi:ss')
and t.orderstatus in(4,5,8)