2

I keep getting the following error:

QueryException: [Syntax Error] line 0, col 114: Error: Expected =, <, <=, <>, >, >=, !=, got '('

I tried using setParameter but I think its a problem with doctrine not support in query in sum?

I know the query work as tested on http://sqlfiddle.com/#!2/36b49/31

     return $this->getEntityManager()
        ->createQuery(
           'SELECT cu.conversation_id
           FROM conversations_users cu
           GROUP BY cu.conversation_id
           HAVING sum(cu.user_id in (1,2,3,4)) = 4
           AND sum(cu.user_id not in (1,2,3,4)) = 0 '
        )
    ->getResult();  

0 Answers0