Hi Alessandro, There are a number of ways to do this. See http://snippets.symfony-project.org/snippet/75 Criteria::CUSTOM has worked well for me, but make sure to manually escape any variables used here with a mysql_real_escape_string($var,Propel::getConnection()).
Cheers, Stig alessandro wrote: > Hi all! > > I can't find the way to create nested querys with propel. Can anyone > help me? > > The query is the following: > > SELECT tbl1.location_id, count(tbl1.location_id) as n_commenti from > > (SELECT * FROM locations LEFT JOIN locations_sezioni ON > (locations.LOCATION_ID=LOCATIONS_SEZIONI_LOCATION_ID) where > (((((locations_sezioni.LOCATIONS_SEZIONI_SEZIONE_ID<>4 AND > locations_sezioni.LOCATIONS_SEZIONI_SEZIONE_ID<>5) AND > locations_sezioni.LOCATIONS_SEZIONI_SEZIONE_ID<>9) AND > locations_sezioni.LOCATIONS_SEZIONI_SEZIONE_ID<>10) AND > locations_sezioni.LOCATIONS_SEZIONI_SEZIONE_ID<>18) AND > locations_sezioni.LOCATIONS_SEZIONI_SEZIONE_ID<>19) group by > location_id) > > as tbl1 join commenti on commento_contenuto_id=tbl1.location_id group > by tbl1.location_id > > Thanks > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---