Hello everyone,
I am totally lost in implementing the following sql using cakephp ORM
SELECT *
FROM users
WHERE users.id NOT
IN (
SELECT potentials.user_id
FROM potentials
)
I have tried this but it is not working at all
$this->User->find('all', array(
'contain' => array(
'City' => array(
'fields' => array('id', 'name')
)
),
'conditions' => array(
'NOT IN' => array('Select user_id from potentials')
)
));
I have also tried this method mentioned on the book.cakephp.org but it didn't proved of much help.
Please help me write this query in cakephp way.
Thanks