How do I query records from a related parent object?
You can query parent records using relationship.field dot notation and have the query results displayed in one, simple table for browser viewing or CSV export. For example, to get your Contact’s Account Name, First Name, Last Name, and Owner’s Name, write your SOQL query like this: SELECT Account.Name, LastName, FirstName, Owner.Name FROM Contact Just remember to use the relationship names (“Account” and “Owner” in this case) to traverse the hierarchy up to five levels separated by dots. These names can be found under in the sub-folders of the fields on the Describe tab.