select distinct A.ID from A where A.ID not in (select ID from B) select A.ID from A left join B on A.ID=B.ID where B.ID is null select * from B where (select count(1) as num from A where A.ID = B.ID) = 0 SELECT * FROM b WHERE NOT EXISTS(SELECT 1 FROM a WHERE a.ID=b.ID) --相同数据 select tel_no from a intersect select tel_no from b --不同数据 select tel_no from b except select tel_no from a
原文地址:https://www.cnblogs.com/Jerrycjc/p/8516246.html
时间: 2024-10-07 02:18:44