0

I'm using Java to query SF, using the aPI version 33.0. I'm trying to submit the following query

SELECT Id, EODBID__c from Account where Id in (Select AccountId from Opportunity where RecordTypeId in (select Id from RecordType where Name = 'My Record Type'))

but its returning the error

ERROR at Row:1:Column:120

Nesting of semi join sub-selects is not supported

Is there another way I can write the above to avoid this error? I would prefer to submit a single query only.

1

You can't nest more than once, as the error says, but in this case, you can use the relationship field instead:

SELECT Id, EODBID__c 
from Account 
where Id in 
  (Select AccountId 
   from Opportunity 
   where RecordType.Name = 'My Record Type')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.