在两张表(A表和B表)里面找出A中不存在B表的记录

表A(Test1)

表B(Test2)

sql 语句:

 select a.Id,a.Name from Test1 a where not exists
 (select b.Id from Test2 b where a.Id=b.Id)

查询结果为:

原文地址:https://www.cnblogs.com/liuming8208/p/2538966.html