Is it possible to to compare the parent id of an account to another account? i.e.
SELECT Id from Account WHERE child_account.parentId = parent_account.Id;
I keep getting the 'Unknown Error parsing query' message from the Query Editor.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
You cannot compare a field to another field in SOQL. The standard workaround is to use a formula. It's hard to tell what you're trying to achieve based on your syntax, but if you wanted to filter on records where one field equals another, you would do make a formula (say
DoesField1EqualField2__c) that looks like:
Field1__c = Field2__c
And then in your query, filter on that:
SELECT Id FROM Account WHERE DoesField1EqualField2__c = true