Salesforce Salesforce Object Query Language (SOQL) Using a Semi-Join


Example

Selecting all accounts that have open opportunity records under them

SELECT Id, Name FROM Account WHERE AccountId IN 
    (SELECT Id FROM Opportunity WHERE IsClosed = false)