解决方案 »

  1.   

    试试闪回查询,用现在表中的数据minus闪回查询的数据,差值就是你想查的数据
    select * from tb1
    minus
    select * from  tb1 as of  timestamp to_timestamp('2007-05-12 13:22:33', 'YYYY-MM-DD HH24:MI:SS')
    --时间自行调整
      

  2.   

    -- 如果 operdate 是你的插入日期, 可以用下面的方法删除 。
    -- 之前最好 select 一下,使用同样的条件 。
    delete tb1 
    where operdate between to_date('2014-11-26 00:00:00,''yyyy-mm-dd hh24:mi:ss) 
     and to_date('2014-11-26 23:59:59,''yyyy-mm-dd hh24:mi:ss) 
      

  3.   

    那么问题来了……如果数据是按operdate顺序插入的
    可以delete from xxx t1 where (select count(1) from xxx t2 where t2.operdate>t1.operdate)<100或者如果undo没被覆盖
    delete from xxx t1 where t1.rowid not in (select t2.rowid from xxx as of timestamp to_date('2014-11-25 12:00','YYYY-MM-DD HH24:MI') t2)
    把时间改成合适的值,会将后来插入的数据删掉
    用flashback table xxx to timestamp to_date(xxx,xxx);也行,但是要小心数据丢失
      

  4.   

    忘了讲了,真正要操作的表中没有operdate这列,也没有自增长的列,所以从这两方面入手是不可以的~
      

  5.   

    先用1#的方法找到这些记录,确认是否是这些记录,然后利用下面语句删除
    delete from tb1
    where rowid in (select rowid from tb1
    minus
    select rowid from  tb1 as of  timestamp to_timestamp('2007-05-12 13:22:33', 'YYYY-MM-DD HH24:MI:SS'))
      

  6.   

    楼主用发的ROWNUM很危险,谨慎处理
    可以考虑从其他相关点进行处理:如操作时间