yeafee@夜飞郎

it's usually better to solve problems with simplicity and finesse rather than muscle.

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  33 随笔 :: 3 文章 :: 2 评论 :: 0 Trackbacks

select     count  (  distinct  (di.docu_id  ||  di.policy_no || to_char(di.scan_date,  '  yyyymmdd  '  ))),di.docu_id 
 
from   docu_index di   where   
di.scan_date 
>  last_day(add_months(sysdate,  -   2  ))  +   1     -- 上月第一天
and   
di.scan_date 
<  LAST_DAY(add_months(sysdate,  -   1  ))   -- 上月最后一天  
group     by   di.docu_id 
posted on 2007-12-17 14:00 @yeafee 阅读(613) 评论(0)  编辑  收藏 所属分类: 数据库

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


网站导航: