私は以下のような質問があります:
SELECT t.id, t.name, count(i.id) FROM Acme\TestBundle\Entity\Tags t
LEFT JOIN t.items i WITH i.status=1 AND (SELECT count(img.id) FROM Acme\TestBundle\Entity\ItemsImages img WHERE img.item=i.id) > 0
GROUP BY t.id
ORDER BY COUNT (i.id) DESC
このクエリは、ORDERBY句がなくても正常に機能します。この句を追加するたびにエラーが発生します:
[Syntax Error] line 0, col 297: Error: Expected end of string, got '('
ORDER BYは列名では機能しますが、count(i.id)などの列では機能しません