You need to sign in to do that
Don't have an account?
Dritter
SOQL Across Child Records with WHERE Statement
I'm trying to find accounts with a student schools that have a school type of "med_us." However, when I add the WHERE statement to the inner select it times out. See below:
SELECT id, Educational_Background__c FROM Account WHERE ID IN (SELECT Account__c FROM Student_School__c WHERE school_type__c = 'med_us') AND Educational_Background__c = 'IMG'AND createddate = TODAY
If I remove the WHERE statement it runs fine, but it's not giving me the info I need:
SELECT id, Educational_Background__c FROM Account WHERE ID IN (SELECT Account__c FROM Student_School__c ) AND Educational_Background__c = 'IMG'AND createddate = TODAY
When searching for records across child objects are we allowed to use WHERE statements?
I've also tried this:
SELECT id, Educational_Background__c FROM Account WHERE ID IN (SELECT Account__c FROM Student_School__c) AND Educational_Background__c = 'IMG'AND createddate = TODAY AND school_type__c.student_school__r ='med_us'
SELECT id, Educational_Background__c FROM Account WHERE ID IN (SELECT Account__c FROM Student_School__c WHERE school_type__c = 'med_us') AND Educational_Background__c = 'IMG'AND createddate = TODAY
If I remove the WHERE statement it runs fine, but it's not giving me the info I need:
SELECT id, Educational_Background__c FROM Account WHERE ID IN (SELECT Account__c FROM Student_School__c ) AND Educational_Background__c = 'IMG'AND createddate = TODAY
When searching for records across child objects are we allowed to use WHERE statements?
I've also tried this:
SELECT id, Educational_Background__c FROM Account WHERE ID IN (SELECT Account__c FROM Student_School__c) AND Educational_Background__c = 'IMG'AND createddate = TODAY AND school_type__c.student_school__r ='med_us'