not in ,not exist 区别

发布网友

我来回答

1个回答

热心网友

个人认为采用:not exists 比较好点恩
select *
from A, ( select distinct y from B ) B where A.x = B.y;
select * from A where exists ( select null from B where y = x )
执行的过程相当于:
for x in ( select * from A )
loop
if ( exists ( select null from t2 where y = x.x )
then
OUTPUT THE RECORD
end if
end loop
从这里就可以看出来了

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com