Oracle 查询某个时间之内的数据

//一月之内
SELECT * FROM ESS.E_LOG WHERE E_LOG."ETime" BETWEEN sysdate-interval '7' month AND SYSDATE;

SELECT * FROM ESS.E_LOG
WHERE to_char(E_LOG."ETime",'yyyy-mm-dd hh24:mi:ss') between to_char(sysdate-225,'yyyy-mm-dd hh24:mi:ss') and to_char(sysdate,'yyyy-mm-dd hh24:mi:ss');

//一周之内
select * from ESS.E_LOG where E_LOG."ETime" > sysdate - interval '7' day;


//一年之内
select count(*) from ESS.E_LOG WHERE E_LOG."ETime" BETWEEN sysdate-interval '1' year AND SYSDATE;

//sysdate获取的时间是Oracle数据库系统时间
select sysdate from dual;