You need to sign in to do that
Don't have an account?
Josephine But
I am trying to query from relationship
Hi,
I have an object appointments which have a lookup field to Hospital(Hospital__c) and I have an object Hospital which contains the names of the hospital. I want to know how many appointments in each hospital. What is the query look like?
Thanks,
Jo
I have an object appointments which have a lookup field to Hospital(Hospital__c) and I have an object Hospital which contains the names of the hospital. I want to know how many appointments in each hospital. What is the query look like?
Thanks,
Jo
Hi Josephine,
Can you elaborate more on the ask?
To know the number of appointments for eah hospital, the querry can be look like -
If this helps you, please mark it as a best answer
Thanks!
Hi Josephine,
you can use a below SOQL query to achieve this
SELECT Hospital__c, COUNT(Id) FROM Appointment__c GROUP BY Hospital__c
Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.
Thanks,
Naresh