Sql语句中IN和exists的区别及应用

not in 和not exists   若是查询语句使用了not in 那么内外表都进行全表扫描,没有用到索引;而not extsts 的子查询依然能用到表上的索引。因此不管那个表大,用not exists都比not in要快。html   in 是把外表和内表做hash 链接,而exists是对外表做loop循环,每次loop循环再对内表进行查询。一直以来认为exists比in效率高的说法是不
相关文章
相关标签/搜索