我有两个mysql表
表A
colA1 colA2
1 whatever
2 whatever
3 whatever
4 whatever
5 whatever
6 whatever
第二个表基本上是从表A派生的,但删除了一些行
表B
colB1 colB2
1 whatever
2 whatever
4 whatever
6 whatever
如何编写一个查询来获取上面两个表中缺失行的表
即
colC1 colC2
3 whatever
5 whatever
最佳答案
SELECT t1.*
FROM TableA t1 LEFT JOIN
TableB t2 ON t1.ID = t2.ID
WHERE t2.ID IS NULL
关于mysql - 如何在mysql中获取缺失行的表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2424793/