时间:2021-07-01 10:21:17 帮助过:1人阅读
简单比较
1、SELECT * FROM t2 WHERE id NOT IN (SELECT id FROM t1);
2、SELECT * FROM t2 WHERE NOT EXISTS(SELECT * FROM t1 WHERE t1.id=t2.id);
3、SELECT t2.* FROM t2 LEFT JOIN t1 ON t2.id=t1.id WHERE t1.id is null;
MySQL:比较两个数据表不同部分
标签:log 数据表 null 简单比较 join sel blog mys 不同