Welcome 微信登录

首页 / 数据库 / MySQL / not exists比not in效率要高

数据库: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个一比较简直是太明显了。具体环境分析不使用MySQL的理由用Oracle管理服务器将数据导入与导出相关资讯      not exists  not in  本文评论 查看全部评论 (0)
表情: 姓名: 字数