[oracle] 求9月份连续两天打电话的记录,求大神帮忙 纠结一天了

问题是这样的,项目经理叫我求出今年9月份的连续两天有打电话的记录 最终版效果是这样的
id max(accept_time) min(accept_time) count(*) group_name

5962 2014/9/1 3:45:57 2014/9/1 3:45:57 1 网管中心.网络监控中心

balk_phone`
10011

就是这个部门group_name 连续在9月份连续两天有电话有记录的数量

我在写到这一步 还是不对

select abview.*, g.group_name
  from (select min(t.accept_time) mi,
               max(t.accept_time) ma,
               count(*),
               t.first_dept_id,
               balk_phone
          from balk_basic t
         where t.balk_phone is not null
           and t.accept_time >= to_date('20140901', 'YYYY-MM-DD')
           and t.accept_time <= to_date('20140929', 'YYYY-MM-DD')
        group by t.accept_time - rownum, t.first_dept_id, t.balk_phone
        having count(*) >2) abview,
       ifm_sys_group g
 where g.GROUP_DEPT_ID = abview.first_dept_id;

因为你没有给表的结构。所以,我只能揣测!我个人觉得,问题出在分组上。
就是这里

group by t.accept_time - rownum, t.first_dept_id, t.balk_phone