+ Start a Discussion
deepthi reddy 24deepthi reddy 24 

Difference between Opportunity and Opportunities.

SELECT Id,(SELECT Id FROM Opportunities) FROM Account. This SOQL works but not SELECT Id,(SELECT Id FROM Opportunity) FROM Account. Can anyone explain? Also, SELECT Id FROM Opportunity worked.
nitin sharma 366nitin sharma 366
SELECT Id,(SELECT Id FROM Opportunities) FROM Account. 
When you query parent and child records you have to use plural name which is Opportunities.Here opportunites is a relationship name and opportunity is an object name.All objects in salesforce when they are in relationship have relatationship name so use it to query parent to child object