Activity Forums Salesforce® Discussions How to perform inner query in SOQL (Salesforce Object Query Language)? Reply To: How to perform inner query in SOQL (Salesforce Object Query Language)?

  • Subhendu

    Member
    January 12, 2018 at 12:27 pm

    Hi Ankit,

    You need the relationship name to perform inner SOQL query. For example, if you are going to perform a query to get Accounts along with their contacts then your query will be something like -

    Select Id, Name,(Select Id, LastName from Contacts) from Account.

    Where Contacts is the relationship name between Account and Contact.

     

    Hope this helps,

    Thanks,

    Subhendu