上万条数据如果是一个子查询,或者表
可以用 not exists 或者外连接 判断

解决方案 »

  1.   

    例如 记录在a表
         插入表为b表select a.*
    from a left outer join b
    on ..关联字段
    where b.col is null
      

  2.   

    根据ID 关联下查查
    用not in()  或者 no exists()比如:select A.id from A where not exists(select 1 from B where A.Id=B.ID)
      

  3.   

    select * from tab0   ---要查入的表
    union
    select * from tab1   ---查入后的表
      

  4.   

    通过表中唯一标示进行minus操作如:
    select  column1 from tab1   --源表
    minus
    select  column1 from tab2   --目标表
      

  5.   

    呵呵minus..select columnname from srctable
    minus
    select columnname from distable