红联Linux门户
Linux帮助

not exists比not in效率高

发布时间:2007-06-06 00:20:30来源:红联作者:source
数据库:oracle
数据量:52000条记录
用not exists比not in执行的效率要高的多

select * from quyu_t a where a.version='256' and not exists(select 'x' from quyu_t_his b
where a.username=b.username);

-------用not in效率低
select * from quyu_t where username not in (select username from quyu_t_his)

2个一比较简直是太明显了。
文章评论

共有 0 条评论