试试这个:
select CUS_ID,ACC_NBR from A
where not exists (select 1 from b where a.ACC_NBR = b.ACC_NBR )
select CUS_ID,ACC_NBR from A
where not exists (select 1 from b where a.ACC_NBR = b.ACC_NBR )
建索引我记得有利也有弊,因为我不是程序,只是一个数据库,为了方便分析用。
建索引我记得有利也有弊,因为我不是程序,只是一个数据库,为了方便分析用。哦,这个not in 和not exists ,产生的执行计划应该是不一样,not exists的效率更高。