简单比较
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;
标签:log 数据表 null 简单比较 join sel blog mys 不同
简单比较
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;
标签:log 数据表 null 简单比较 join sel blog mys 不同
原文地址:https://www.cnblogs.com/go-wandering/p/8297222.html