试试
select * from test08 a
where not exists(select nbr from disct@towe t
where disct=12 and t.nbr=a.nbr)
select * from test08 a
where not exists(select nbr from disct@towe t
where disct=12 and t.nbr=a.nbr)
调试欢乐多
在效率上应该差不多吧!
in 比not in快吧
例子很多,自己找找,试试
from ( select distinct nbr from test08 minus select distinct nbr from disct@towe where disct=12 ) a, test08 b
where a.nrb = b.nrb
where not exists(select nbr from disct@towe t
where disct=12 and t.nbr=a.nbr)
不要轻易的使用 in 或者是 not in ,这会大大降低执行速度
赞成bzszp(www.bzszp.533.net)的写法
另外,Exist比IN字句快的多。
where not exists(select nbr from disct@towe t
where disct=12 and t.nbr=a.nbr)