Cakephp查找两个连接表中已删除的行


Cakephp Find removed rows of two joined tables

我有表A和表B,它们都通过一种关系连接在一起。表B具有表a的密钥的外键。程序运行时会加入表A,因为它是动态的,可以驻留在任何数据库中。如何查找表B中不再在表A中找到的所有行?

For ex.
Starting out we have
table A     table B
4              4
3              3
5              5

当晚晚些时候

table A deleted some rows
table A        table B
NULL              4
3                 3
NULL              5

我想拿到钥匙4,5,这样我就可以知道删除了什么。

只需在不在表中的位置使用mysql。我只想使用cakepp查询方法而不是find。这里有一个已经回答过的话题:表中不包含的地方