On Mar 20, 12:54 pm, Marcin Krol <mrk...@gmail.com> wrote: > However, I have a problem doing a query at SQLA level that will select > email, hwrep name and project name. The simple SQL query is straightforward: > > select email.Email, project.Project, hwrep.HWRep from email, project, > hwrep, project_hwreps where hwrep.id = project_hwreps.HWRep_id and > project.id = project_hwreps.Project_id and hwrep.Email_id = Email.id; > > I have tested that this query selects just what I want. > > However, I would like to be able to use SQLA query mech for this, but I > have trouble constructing the query.
Try session.query(Email.Email, Project.Project, HWRep.HWRep).join (HWRep.Projects, HWRep.Email) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---