I need to reproduce the following query with DbFinder. i'm using the
results to build a list of checkboxes that will already be checked if
they have a row in the relations table.

SELECT
  et.event_type_id, et.name, etpni.news_item_id AS selected
FROM
  event_types et
LEFT JOIN
  event_types_per_news_item etpni ON (et.event_type_id =
etpni.event_type_id AND etpni.news_item_id = 621)
GROUP BY
  et.event_type_id
ORDER BY
  et.name

The bit i'm strugging with is the "AND etpni.news_item_id = 621" in
the ON clause. I can't use a WHERE after the LEFT JOIN because I want
event types returning even if there is no matching row in the
relations table so that I can still show an empty checkbox.

I'm using sf1.0.20 / propel 1.2 / DbFinder 1.2.2


--~--~---------~--~----~------------~-------~--~----~
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