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)

 

相关文章:

  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
  • 2021-08-11
  • 2022-01-13
猜你喜欢
  • 2022-12-23
  • 2021-11-14
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2021-08-31
相关资源
相似解决方案