I'm using a SOQL to query the lookup relationships.
Primary Object: Opportunity
Secondary Object: Purchase__c.
From purchase__c we have a lookup to opportunity.
Field Name: Opportunity__c
Child Relationship Name: Purchases2
for (Opportunity opp : [select Id, Name, (select id from Purchases2__r where Count__c>0) from Opportunity where Id IN :oppIds])
whats wrong with my query? getting error below:
If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name.