tags:

views:

267

answers:

0

Is it possible to use aggregate values in Doctrine_RawSql query? Here's what I'm trying to do:

$q = new Doctrine_RawSql();
$q->select('{q.*}, AVG(a.value) AS avg');
$q->from('-- complex from clause');
$q->addComponent('q', 'Question');

However, SQL created by Doctrine leaves only columns from table question and omits aggregate value avg.