You need to sign in to do that
Don't have an account?

How to find the accounts & contacts with different owners
The following query works fine in SOQL
select account.name,name,account.ownerid,ownerid from contact limit 10
so all the fields are available.
This one is unparsable by SOQL
select account.name,name,account.ownerid,ownerid from contact where account.ownerid!=ownerid limit 10
Anyway to do this ?
Are we looking to (extract) data from contact where the owner of contact is different from that of parent account's owner?
If that is the case, I think this query might work. Let me know your thoughts.
SELECT Account.OwnerId, Account.Name, Name, OwnerId
FROM Contact
WHERE OwnerId NOT IN
(SELECT OwnerID FROM Account)
Raish
All Answers
Are we looking to (extract) data from contact where the owner of contact is different from that of parent account's owner?
If that is the case, I think this query might work. Let me know your thoughts.
SELECT Account.OwnerId, Account.Name, Name, OwnerId
FROM Contact
WHERE OwnerId NOT IN
(SELECT OwnerID FROM Account)
Raish
Perfect,
thanks Raish.
If you have few seconds, please mark it as solution for future references for someone stucked in similar situation.