Hi all,
here is a problem I am stuck with:

I have a table supplier and would like to use a correlated subquery
for ordering of the results from this table:

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


Doctrine rewrites this to
SELECT s.id AS s__id, s.user_id AS s__user_id, s.company_name AS
s__company_name, s.supplier_name AS s__supplier_name,
s.physical_address AS s__physical_address, s.physical_town AS
s__physical_town, s.physical_postcode AS s__physical_postcode,
s.country_id AS s__country_id, s.full_postal_address AS
s__full_postal_address, s.telephone_1 AS s__telephone_1, s.telephone_2
AS s__telephone_2, s.telephone_3 AS s__telephone_3, s.fax AS s__fax,
s.email_1 AS s__email_1, s.email_2 AS s__email_2, s.email_3_paypal AS
s__email_3_paypal, s.instant_messaging_1 AS s__instant_messaging_1,
s.instant_messaging_2 AS s__instant_messaging_2, s.instant_messaging_3
AS s__instant_messaging_3, s.website_1 AS s__website_1, s.website_2 AS
s__website_2, s.type_of_supplier_id AS s__type_of_supplier_id,
s.type_other AS s__type_other, s.supplier_expertise_keywords AS
s__supplier_expertise_keywords, s.native_language_id AS
s__native_language_id, s.is_specialised_in_personal_doc AS
s__is_specialised_in_personal_doc, s.is_complete AS s__is_complete,
s.created_at AS s__created_at, s.updated_at AS s__updated_at FROM
supplier s ORDER BY (SELECT AVG(r.supplier_rating_id) AS r__0 FROM
rating r, supplier s2 WHERE (r.supplier_id = s2.id)) DESC


Can I somehow tell doctrine to make supplier correlated?

Thank you for any help.

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