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 Answer 1

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')

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .