我如何在cakePHP(v2.5)中编写此查询
SELECT count(*)
FROM websites
WHERE view > (SELECT view
FROM websites
WHERE id = 212)
答案 0 :(得分:0)
您可以尝试:
$this->find('count', array(
'conditions' => array('websites.view > SELECT view FROM websites WHERE id = 212')
));
请查看Cookbook