简单比较
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;
原文地址:https://www.cnblogs.com/go-wandering/p/8297222.html
时间: 2024-10-31 21:38:36