1. 程式人生 > >oracle 中查詢本年、本月、 本週的資料

oracle 中查詢本年、本月、 本週的資料

     --本週

select * from 表 where time > sysdate - (to_char(sysdate-1,'D')) --本月 select * from 表 where time>=TRUNC(SYSDATE, 'MM') and time<=last_day(SYSDATE) --本年 select * from 表 where to_char(time,'yyyy')=to_char(sysdate,'yyyy')