Подойдите к одному (похоже на ваш пример кода):
// Retrieve ONLY the id, and use hydration mode that produces a simple array of results.
$first_ids = Doctrine_Query::create()
->select('f.id')
->from('First f')
->execute(array(), Doctrine_Core::HYDRATE_SINGLE_SCALAR);
$two = Doctrine_Query::create()
->from('Second s')
->whereNotIn('first_id', $first_ids);
return $two->execute();
Другой способ получить тот же результат в одном составном запросе:
$two = Doctrine_Query::create()
->from('Second s')
->where('first_id NOT IN (SELECT id FROM First)');
return $two->execute();