I would like to perform a SELECT from the results of a subquery in DQL. This is equivalent to doing the following in SQL:
SELECT * FROM ( SELECT foo1,foo2 FROM bar ) where foo1='something';
The problem I am facing is that she complains that
Error: Class '(' is not defined
The actual DQL that produces this error:
SELECT u FROM ( SELECT u, COUNT(u) as total FROM Utterance u LEFT JOIN u.recordings r WHERE r.speaker IS NULL OR r.speaker <> 5 GROUP BY u.id ) matched WHERE total < 5
So, to repeat, how can I make a selection from a subquery?
source share