Search code examples
doctrineleft-joindql

dql and leftjoin


I'm trying to create a DQL query with two conditions in a left join. It's ok with one condition, but impossible to find the semantic for more conditions. Just below a SQL example about what I'm trying to write in DQL:

SELECT 
u.id AS uid,
FROM user u 
LEFT JOIN phonenumber p ON (u.id = p.user_id AND u.status='1')
HAVING COUNT(p.id) > 3

Thanks


Solution

  • Did you try ON and/or WITH keywords?