You need to sign in to do that
Don't have an account?
MarkInAtlanta
SOQL using a relationship in a where clause?
Scratching my head on this one. Want to find accounts whose owner is different than its parent account.
throws a parsing syntax error when i compare the 2 fields, although i can compare them individualy..
Query works fine without the Where clause, just wahay too many returns to efficiently process them.
Select Id, OwnerId , Parent.OwnerId From Account
where OwnerId != Parent.OwnerId
throws a parsing syntax error when i compare the 2 fields, although i can compare them individualy..
Query works fine without the Where clause, just wahay too many returns to efficiently process them.
Select Id, OwnerId , Parent.OwnerId From Account
where OwnerId != Parent.OwnerId
http://help.salesforce.com/HTViewSolution?id=000187460
All Answers
http://help.salesforce.com/HTViewSolution?id=000187460
Unfortunately, you can not use field comparison in where clause.
But one easy solution is, create formula field on child object and mark it as false if owner is not matching.
Then use this field in query as where clause.
Please mark this answer as best if my reply helped.