The Query should check if any children exist on the parent(opportunity) when i create a new child(project join). Where am I going wrong? Opportunity__c is master detail field on the child Project Join custom object. It is still pulling from all project joins and not the ones associated with the parent opp from which I am creating the new child record.
> List<Project_Join__c> c = [SELECT id, opportunity__c FROM
> project_Join__c WHERE
> opportunity__c IN (SELECT id FROM Opportunity)];