存在性判断如何写更有效率
--存在性判断如何写更有效率
--表a与表b都有item_code字段,表b有数百万条数据,表a每次几十到数百条不等,
--如何有效率的方式从表a中读取不存在于表b的数据
--写了下面两种,还有没有其它的,关键是要执行效率
1:select a.* from a where a.item_code not in (select item_code from b)
2:select a.* from a where not exists(select * from b where b.item_code = a.item_code)