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)