WHERE … IN query with sub-query in Doctrine queryBuilder or equivalent
问题 In my Symfony 4 project I have a User entity and a UserRepository . I'm trying to implement the equivalent of this SQL query in the QueryBuilder (Doctrine 2) or even in DQL . SELECT * FROM user WHERE account_manager_id IN (SELECT id FROM user WHERE account_manager_id = :managerAdminId AND roles LIKE '%ROLE_MANAGER%') Or maybe use a different syntax. I tried different things, but couldn't figure out how to write the WHERE ... IN with the sub-query. This is all I could come up with, which I don