FIRST:
id | name
1 | sss
2 | ddd
5 | fff
$q = Doctrine_Query::create()
->from('First a');
return $q->execute();
SECOND:
id | first_id | name
....
$two = Doctrine_Query::create()
->from('Second a')
->whereInNot(first_id, $q) // ???????
;
return $two->execute();
How can i get all data from table SECOND without first_id existing in table FIRST?
Approach one (similar to your example code):
Another approach to get the same result in a single compound query: