【问题标题】:Cakephp join table syntaxCakephp 连接表语法
【发布时间】:2011-12-21 21:46:04
【问题描述】:

如何设置表 A 和 B 之间的关联,如果表 B 中存在记录,则不会显示任何内容(如内部连接反向)。 这可以使用 Exists 或 not Exists 来完成吗? cakephp 的语法是什么?

【问题讨论】:

    标签: mysql cakephp join


    【解决方案1】:

    您可以使用not exists

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

    【讨论】:

      猜你喜欢
      • 2012-09-24
      • 1970-01-01
      • 1970-01-01
      • 2011-05-10
      • 1970-01-01
      • 2015-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多