试试
select  *  from    test08  a  
where  not  exists(select  nbr  from    disct@towe t   
where  disct=12 and t.nbr=a.nbr)

解决方案 »

  1.   

    in,not in 与exists,not exists 
    在效率上应该差不多吧!
      

  2.   

    用minus减
    in 比not in快吧
    例子很多,自己找找,试试
      

  3.   

    select * 
    from ( select distinct nbr from test08 minus select distinct nbr from  disct@towe  where disct=12 ) a, test08 b
    where a.nrb = b.nrb
      

  4.   

    赞成bzszp(www.bzszp.533.net)的写法
      

  5.   

    select  *  from    test08  a  
    where  not  exists(select  nbr  from    disct@towe t   
    where  disct=12 and t.nbr=a.nbr)
    不要轻易的使用 in 或者是 not in ,这会大大降低执行速度
      

  6.   

    minus要求两个表查询的字段要一样,才行
      

  7.   

    赞成bzszp(www.bzszp.533.net)的写法
      

  8.   

    no exists,
    赞成bzszp(www.bzszp.533.net)的写法
      

  9.   

    SQL Server版中有一个邹健,蛮猛!你应该去问问他!
    另外,Exist比IN字句快的多。
      

  10.   

    exists 比 in 字句快的多,你也太看不起oracle了,8.1.4后in与exists是一样的。看看你的执行计划就知道了
      

  11.   

    select  *  from    test08  a  
    where  not  exists(select  nbr  from    disct@towe t   
    where  disct=12 and t.nbr=a.nbr)