select a.* from smtopm a INNER JOIN iir b on a.item_key!=b.itm_key假设a和b表的数据关系是1:1,假设a表有m条数据,b表有n条数据,那么最后就应该有m*(n-1)条数据,楼主希望得到的是这个结果么?
!= 关系表达式已不能使用索引 select a.* from smtopm a where not exists (select 1 from iir b where a.item_key = b.itm_key)
to beckhambobo(beckham) : select a.* from smtopm a where not exists (select 1 from iir b where a.item_key = b.itm_key) 这句执行的结果和楼主的 select a.* from smtopm a INNER JOIN iir b on a.item_key!=b.itm_key 不一样吧 楼主这句的结果应该是存在非常多的重复纪录的
select a.*
from smtopm a
where not exists (select 1 from iir b where a.item_key = b.itm_key)
select a.*
from smtopm a
where not exists (select 1 from iir b where a.item_key = b.itm_key)
这句执行的结果和楼主的
select a.* from smtopm a INNER JOIN iir b on a.item_key!=b.itm_key
不一样吧
楼主这句的结果应该是存在非常多的重复纪录的