SQL查询~ 存在一个表而不在另一个表中的数据

方法:

1、not In

2、Left join

3、

select * 
from tmptable1
where (select count(1) from tmptable2 where tmptable1.agentid = tmptable2.agentid and tmptable1.phone = tmptable2.phone)=0
原文地址:https://www.cnblogs.com/sshoub/p/3158519.html