Bug Report
Summary
Trying to create this query:
SELECT PARENT_ID
FROM rel
GROUP BY PARENT_ID
HAVING SUM(PROP_ID NOT IN (5,1)) = 0
AND SUM(PROP_ID = 1) = 1
AND SUM(PROP_ID = 5) = 1
(from https://stackoverflow.com/a/14113307)
Using
$qb->andHaving('SUM(props.id NOT IN (:propIds)) = 0');
results in Expected Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS, got 'NOT'.
Using
$qb->andHaving($qb0->expr()->sum($qb0->expr()->notIn('prop.id', ':propIds'), '0'));
results in Expression of type 'Doctrine\ORM\Query\Expr\Math' not allowed in this context.
Is this no Mysql-agnostic syntax maybe?