标签:sel rgb null join back pre rom sele 方法
比如:A,B两表,找到ID字段中,存在A表,但不存在B表的数据。
A表共13w,去重后3w,
B表共2W,且有索引
not in,易理解,效率低,时间:1.395s
select distinct A.id from A where A.id not in(select id from B)
left...join...on ,B.id isnull 时间:0.739s
select A.ID from A left join B on A.ID=B.ID where B.ID is null
效率高,时间:0.57s
select * from A where (select count(1) as num from B where A.ID = B.ID) = 0
标签:sel rgb null join back pre rom sele 方法
原文地址:https://www.cnblogs.com/starzy/p/11146056.html