`
lishumingwm163.com
  • 浏览: 335039 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

oracle 取得当天当月当年

 
阅读更多
1. 当天 createdtime 参数

select? * from tablename t?where where trunc(sysdate)=trunc(t.createdtime);

2.当月 createdtime 参数

select * from tablename t where t.createdtime>=trunc(SYSDATE, 'MM') and t.createdtime<=last_day(SYSDATE)

?

3.当年 createdtime 参数
select * from table t??where t.createtime>=trunc(sysdate,'YYYY')??and t.createtime<=add_month(trunc(sysdate,'YYYY'),12)-1

?

1. 当天 createdtime 参数

select? * from tablename t?where where trunc(sysdate)=trunc(t.createdtime);

2.当月 createdtime 参数

select * from tablename t where t.createdtime>=trunc(SYSDATE, 'MM') and t.createdtime<=last_day(SYSDATE)

?

3.当年 createdtime 参数
select * from table t??where t.createtime>=trunc(sysdate,'YYYY')??and t.createtime<=add_months(trunc(sysdate,'YYYY'),12)-1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics