I'm trying to make a quite complex query with the QueryBuilder of Doctrine 2.
I would like to SELECT a SUM of elements FROM the result of a subquery.
Here is what I try for now, trying to guess the use of all() method (see : http://doctrine-orm.readthedocs.org/en/latest/reference/query-builder.html)
$qb = $this->createQueryBuilder('stuff');
$qb->select('SUM(perf_final.perf_ratio) AS stuff_perf, date AS date')
->from($qb->expr()->all($qb2->getDql()), 'perf_final')
->groupBy('YEAR(perf_final.date)')
->addGroupBy('MONTH(perf_final.date)');
But, Symfony tells me that ALL is an undefined method...
Any ideas of what could be a good practice to do what I need?
Thx,