Hi,

figured it out myself.

Couple of lines before my ->orderBy(), there is a line creating the query:

$query = Doctrine::getTable('Supplier')
           ->createQuery('a');

> $query->orderBy("(SELECT AVG( supplier_rating_id ) FROM rating WHERE
> rating.supplier_id = supplier.id) DESC");
>

The table alias in the orderBy needs to match the alias specified in
createQuery('a') (alias is 'a'):

$query->orderBy("(SELECT AVG( supplier_rating_id ) FROM rating WHERE
rating.supplier_id = a.id) DESC");

At least that is what works, I guessed the answer.

Thanks again for reading.

Jochen

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to