You need to sign in to do that
Don't have an account?
Irina Khomyakova 38
Help with SOQL query using parent-child relationships
I am trying to build SOQL query displaying credit summary for a particular student. We're on EDA so we're trying to use the Course, Course Offering, Course Connection, and Contact objects to generate this.
Here is query that displays information we need, but only for courses particular student enrolled. We would need to add course information for courses that student is not enrolled.
select (SELECT hed__Course_Offering__r.hed__Course__r.Subject__c,
hed__Course_Offering__r.hed__Course__r.Catalog_Number__c,
hed__Course_Offering__r.hed__Course__r.Name,
hed__Course_Offering__r.hed__Course__r.hed__Credit_Hours__c, hed__Course_Offering__r.hed__Course__r.Course_Name_in_Native_Language__c,
Letter_Grade__c
FROM hed__Student_Course_Enrollments__r where Subject__c ='GDBA' and Catalog_Number__c LIKE '71%')
from Contact where Id='0031I00001NcWIBQA3'
I also tried this query, but information is not distinct and not properly formatted:
SELECT hed__Course__r.Subject__c,
hed__Course__r.Catalog_Number__c,hed__Course__r.Name, hed__Course__r.hed__Credit_Hours__c,
hed__Course__r.Course_Name_in_Native_Language__c,
(Select Letter_Grade__c from hed__Course_Enrollment__r where hed__Contact__c = '0031I00001NcWIBQA3')
FROM hed__Course_Offering__c Where hed__Course__r.Subject__c ='GDBA' and hed__Course__r.Catalog_Number__c LIKE '71%'
I would appreciate any suggestions.
Here is query that displays information we need, but only for courses particular student enrolled. We would need to add course information for courses that student is not enrolled.
select (SELECT hed__Course_Offering__r.hed__Course__r.Subject__c,
hed__Course_Offering__r.hed__Course__r.Catalog_Number__c,
hed__Course_Offering__r.hed__Course__r.Name,
hed__Course_Offering__r.hed__Course__r.hed__Credit_Hours__c, hed__Course_Offering__r.hed__Course__r.Course_Name_in_Native_Language__c,
Letter_Grade__c
FROM hed__Student_Course_Enrollments__r where Subject__c ='GDBA' and Catalog_Number__c LIKE '71%')
from Contact where Id='0031I00001NcWIBQA3'
I also tried this query, but information is not distinct and not properly formatted:
SELECT hed__Course__r.Subject__c,
hed__Course__r.Catalog_Number__c,hed__Course__r.Name, hed__Course__r.hed__Credit_Hours__c,
hed__Course__r.Course_Name_in_Native_Language__c,
(Select Letter_Grade__c from hed__Course_Enrollment__r where hed__Contact__c = '0031I00001NcWIBQA3')
FROM hed__Course_Offering__c Where hed__Course__r.Subject__c ='GDBA' and hed__Course__r.Catalog_Number__c LIKE '71%'
I would appreciate any suggestions.
Check this SQL query:- In case you find any other issue please mention.
If you find your Solution then mark this as the best answer.