I'm new to SOQL coming from a SQL background, and need to create a query that will pull in all Contact records where the OwnerID does not match the OwnerID of the Account.
Here is what I have so far:
SELECT a.ID, a.OwnerID,
SELECT c.OwnerID, c.ID
FROM Contacts c
) FROM Account a
I've found lots of examples for "WHERE Name like 'Marshall%' etc, but what I need is to translate this statement in SQL to SOQL:
WHERE c.OwnerID <> a.OwnerID
I know this is not how it's done in SOQL, and am looking for how to write it properly. I have not found an answer to this in Trailhead, Salesforce boards, etc, and I may not know how to phrase the question. Any help would be appreciated.