JAVA—咖啡馆

——欢迎访问rogerfan的博客,常来《JAVA——咖啡馆》坐坐,喝杯浓香的咖啡,彼此探讨一下JAVA技术,交流工作经验,分享JAVA带来的快乐!本网站部分转载文章,如果有版权问题请与我联系。

BlogJava 首页 新随笔 联系 聚合 管理
  447 Posts :: 145 Stories :: 368 Comments :: 0 Trackbacks

公告

 

Locations of visitors to this page
点击这里给我发消息 点击这里给我发消息

常用链接

留言簿(17)

随笔分类(542)

随笔档案(438)

文章分类(182)

文章档案(142)

新闻分类

※→ 【JAVA文档】

※→ 【亲人博客】

※→ 【休闲娱乐】

※→ 【友情链接】

※→ 【学习网站】

※→ 【服务网站】

※→ 【著名网站】

※→ 【阿里博客】

最新随笔

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜

当月数据

Sql代码
  1. select * from table t   
  2. where t.create_time >=TRUNC(SYSDATE, 'MM')   
  3. and t.create_time<=last_day(SYSDATE)  
select * from table t
where t.create_time >=TRUNC(SYSDATE, 'MM')
and t.create_time<=last_day(SYSDATE)


当年数据

Sql代码
  1. select * from table t   
  2. where t.create_time >=trunc(sysdate,'YYYY')   
  3. and t.create_time<=add_months(trunc(sysdate,'YYYY'),12)-1  
select * from table t
where t.create_time >=trunc(sysdate,'YYYY')
and t.create_time<=add_months(trunc(sysdate,'YYYY'),12)-1


本周(国外周日为一个星期第一天)

Sql代码
  1. where t.create_time >=trunc(sysdate,'day')+1 and t.create_time<=trunc(sysdate,'day')+6   
where t.create_time >=trunc(sysdate,'day')+1 and t.create_time<=trunc(sysdate,'day')+6


本周(国内周一为一个星期第一天)

Sql代码
  1. where t.create_time >=trunc(next_day(sysdate-8,1)+1) and t.create_time<=trunc(next_day(sysdate-8,1)+7)+1  

posted on 2010-07-13 10:23 rogerfan 阅读(434) 评论(0)  编辑  收藏 所属分类: 【数据库】

只有注册用户登录后才能发表评论。


网站导航: