Oracle查询中的not in和not exists有什么区别?
What's the difference between not in and not exists in an Oracle query?
我什么时候使用not in?还有not exist?
When do I use not in? And not exist?
推荐答案我认为它具有相同的目的.
I think it serves the same purpose.
not in可以也采用文字值,而not exists需要查询以与结果进行比较.
not in can also take literal values whereas not exists need a query to compare the results with.
not exists可能很好用,因为它可以与外部查询&一起使用join.如果条件使用被索引的列,则可能导致索引的使用.
not exists could be good to use because it can join with the outer query & can lead to usage of index, if the criteria uses column that is indexed.
请参见此问题.
让我把上述事情带回去. 参见此链接.我认为,这完全取决于数据库如何翻译此&在数据库/索引等上.
Let me take the above things back. See this link. I think, it all depends on how the DB translates this & on database/indexes etc.
更多推荐
“不存在"和“不存在"之间有什么区别?
发布评论