Reputation: 12015
I'm using CakePHP 2.1
I have following fields in database.
id
views
max_views
I want to fetch records which has views < max_views
using find query. So what should be the query for it?
Thanks.
Upvotes: 1
Views: 2172
Reputation: 2974
I'd do it like that.
$this -> find('all', array('conditions' => array('views < max_views')));
Upvotes: 6