当月 当年sql
本文转自:http://jophy.javaeye.com/blog/337321
当月数据
-
select
* from table t -
where
t.create_time 'MM')>=TRUNC(SYSDATE, -
and
t.create_time<=last_day(SYSDATE)
当年数据
-
select
* from table t -
where
t.create_time 'YYYY')>=trunc(sysdate, -
and
t.create_time<=add_months(trunc(sysdate, 'YYYY'),12)-1
本周(国外周日为一个星期第一天)
本周(国内周一为一个星期第一天)
邮箱:wangh_2@sina.com
浙公网安备 33010602011771号