On Jan 29, 2013, at 11:49 AM, Hans Meine wrote: > commonResults = (session.query(results1.id, results2.id) > .filter(results1.rel_testCase_id == results2.rel_testCase_id) > .join(session1, results1.rel_session_id == session1.id) > .join(session2, results2.rel_session_id == session2.id) > .filter(session1.rel_algorithm == algorithm1) > .filter(session2.rel_algorithm == algorithm2) > .order_by(results1.rel_testCase_id)) > > This Query alone works well, but if I now try to expand on it, e.g. like this:
I'd change how this join is performed. You'll note the SQL it generates contains a comma in the FROM clause - it's usually going to complicate things if you mix implicit and explicit joins together. The issue should be solved if you create a clean string of joins: s.query(results1.id, results2.id).select_from(results1).join(results2, results1.foo=results2.bar).join(...).join(...) that way when you add another join to OutputParameterValue the query will not have any confusion in how to string this additional JOIN. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.