oracel 数据库中,查询本周,本月,本年数据库

1,查询本周数据

select * from t_Engine_Process_Workitem where start_time >sysdate-to_char(sysdate-1,'D')

备注:start_time指的是要查询的字段,条件

2,查询本月数据

select * from t_Engine_Process_Workitem where start_time>=TRUNC(SYSDATE, 'MM') and start_time<=last_day(SYSDATE)

3,查询本年数据

select * from 表 where 查询字段>=TRUNC(SYSDATE, 'MM') and time<=last_day(SYSDATE)

例:select * from t_Engine_Process_Workitem where start_time>=TRUNC(SYSDATE, 'MM') and start_time<=last_day(SYSDATE)

原文地址:https://www.cnblogs.com/xiaoyuer2121/p/13883628.html