查询中的CakePHP查询

时间:2015-01-27 04:26:52

标签: php cakephp

我如何在cakePHP(v2.5)中编写此查询

SELECT count(*)
      FROM websites
      WHERE view > (SELECT view
                   FROM websites
                   WHERE id = 212)

1 个答案:

答案 0 :(得分:0)

您可以尝试:

 $this->find('count', array(
    'conditions' => array('websites.view > SELECT view FROM websites WHERE id = 212')
));

请查看Cookbook