Quote: 引用 1 楼 yuyishui 的回复:

正在试,可能表比较大吧,正在等

解决方案 »

  1.   

    @yuyishui 方法不好使,跑不出来,但是也非常感谢了,
      

  2.   

    update event e4 set e4.first_flag=1 where exists(
    with s1 as 
    (
    select e1.ani,e1.callstarttime ,e1.event_guid from event e1 
    where 1=1 
    and length(e1.ani)>4
    and callstarttime >=  to_date('20140112 00:00:00','yyyymmdd hh24:mi:ss')
    and callstarttime <    to_date('20140115 00:00:00','yyyymmdd hh24:mi:ss')
    )
    with s2 as
    (
       select e2.ani,e2.event_guid  from s1 inner join event e2  where 1=1 and e2.ani=s1.ani and e2.callstarttime between s1.callstarttime and s1.callstarttime +1  group by e2.ani,e2.event_guid having count(e2.event_guid)>1  ;
    )
    select 1 from s2 where s2.event_guid = e4.event_guid);
      

  3.   

     fetch cur_1 into v_ani,v_calltime,v_eventguid;
                      while cur_1%found loop这个地方不是%notfound吗?这个有什么区别?
      

  4.   

            
            end loop;
            close cur_1;
            COMMIT;
              End;有没有可能是没有commit,在关闭游标时commit了一下
    没有commit的话在另外的窗口中查询结果是没有变化的