oracle 查询本周,本月,本年

 --本周
select * from dual where time > sysdate - (to_char(sysdate-1,'D'))
--本月
select * from dual where time>=TRUNC(SYSDATE, 'MM') and time<=last_day(SYSDATE)
--本年
select * from dual where to_char(time,'yyyy')=to_char(sysdate,'yyyy')
发布了231 篇原创文章 · 获赞 3 · 访问量 7994

猜你喜欢

转载自blog.csdn.net/qq_32265719/article/details/103859042