两种方法不同的效率!
方法1
select * from userinfo,achieveamount where userinfo.unionid = achieveamount.unionid(+) and achieveamount.unionid IS NULL
方法2
select * from userinfo where userinfo.unionid not in (select achieveamount.unionid from achieveamount)
我们要采用方法1这样性能要比2好很多!
本文对比了两种SQL查询方法的效率,方法一是通过外连接查询userinfo表中不存在于achieveamount表的数据;方法二是使用not in进行同样的查询。经过比较发现方法一的性能优于方法二。
103

被折叠的 条评论
为什么被折叠?



