大家想想有什么方法优化下这个SQL?
SELECT A.ID
FROM A
WHERE ID not in ( select ID from B );
想找出在A表有ID,而在B表没有ID的 所有ID号,每张表10W条数据的样子
每次运行内存就彪到1.5G(我2G内存)直接卡死,客户要求用Access
大家想想有什么方法
[解决办法]
select a.idfrom a left join b on a.id=b.idwhere b.id is null
[解决办法]
select a.id from a left join b on a.id=b.id where b.id is null
在连接字段上建立过索引,ID