现有MAP与INFO两张表,他们通过ID字段关联,如何在INFO中搜索一条不在MAP表中的记录

解决方案 »

  1.   

    select * from info a where not exisits (select 1 from map b where a.id = b.id)
      

  2.   

    select * from info a where id not in  (select b.id from map b)
      

  3.   

    select * from into t 
    where id not in(select a.id from map a)
      

  4.   

    oracle没有except
    差集用minus
    既然可以用id关联,就没必要用minus了
    直接not in或not existsminus用在关联字段较多且查询多个字段
      

  5.   

    exists/in可以实现你的功能,
    如果要求集合差的话,就用minus函数