【发布时间】:2013-07-04 13:48:17
【问题描述】:
我正在研究 cakephp 并尝试实现 join 。或者内部连接查询...我现在正在做的是这个
$this->bindModel(array(
'belongsTo' => array(
'Contact' => array(
'className' => 'Contact',
'foreignKey' => false,
'conditions' => array(
'Message.user_id = Contact.user_id',
'Message.mobileNo = Contact.mobileNo'
)
)
)
), false);
return $message_details = $this->find('all', array(
'conditions' => array(),
'fields' => array('DISTINCT mobileNo')
));
此查询正在执行 LEFT JOIN 表.. 我想要的是两个表之间的 join 或 inner join
【问题讨论】:
标签: sql cakephp mysqli cakephp-2.0 cakephp-2.1