I have a db_select that selects row from t_project_proposal_writer table only if in joined t_project_milestone table row with milestone_id 10 is found:
$query = db_select('t_project_proposal_writer', 'p')->fields('p'); $query->innerJoin('t_project_milestone', 'm', 'p.id=m.proposal_id'); $query->condition('p.initiative_nid', $node->nid)->condition('m.milestone_id', 10);
One project row can have 10 milestone rows. Now I need to do another query that selects only the rows from t_project_proposal_writer where milestone_id 10 not exists in joined t_project_milestone.
Is there any other possiblity to do that, instead of query all the projects and iterate throught them while checking if milestone 10 exists?