I need to pull from a custom object and where account (look up field) where partner (child object) role = x
Original query:
select id, account
from customobject
My thought for the partner:
select id, account
from customobject
where account in (
select id from account where id in (
select accountfromid from partner where role = 'x'))
Is there any way of doing this or do I just need to do a separate query from the partner object then query the custom object with account ids in (x)?
customObject
andpartner
SObjects both have a lookup relationship toAccount
?