How to Query/Fetch all accounts which are associated with a particular email id in Contacts to Multiple Accounts Relationship?

How to Query/Fetch all accounts which are associated with a particular email id in Contacts to Multiple Accounts Relationship?

Sample Contact Record:
 

 

SOQL:
SELECT Id, AccountId, Account.Name FROM AccountContactRelation WHERE ContactId IN (
SELECT Id FROM Contact WHERE Email = ‘test@test.com’ )

 
Output:
 

Leave a Reply