Mysql Cakephp连接表语法

Mysql Cakephp连接表语法,mysql,cakephp,join,Mysql,Cakephp,Join,如何设置表A和表B之间的关联,如果表B中存在记录,则根本不会显示像内部连接反转那样的内容。 是否可以使用Exists或not Exists执行此操作?cakephp语法是什么?您可以使用不存在的: select * from tableA a inner join tableB b on b.id not exists (select id from tableA where id <> b.id)

如何设置表A和表B之间的关联,如果表B中存在记录,则根本不会显示像内部连接反转那样的内容。 是否可以使用Exists或not Exists执行此操作?cakephp语法是什么?

您可以使用不存在的:

select * from tableA a
inner join tableB b on b.id not exists (select id from tableA where id <> b.id)