当两个表数据量较大时,not in 和 not exist就不大适用了,很容易就查询超时了,我们可以换个思路,使用左连接进行查询:
select * from a left join b on a,.id=b.id where b.** is null;
当两个表数据量较大时,not in 和 not exist就不大适用了,很容易就查询超时了,我们可以换个思路,使用左连接进行查询:
select * from a left join b on a,.id=b.id where b.** is null;