Apologies since this seems like a basic question, but what is the best practice syntax for performing multiple joins against a single table? The documentation examples clearly demonstrate how to join
2 tables together, but examples with 3 or more are unclear.

For example, it seemed like this should work:

query = select([table1, table2, table3], ((table1.c.foo_id == table2.c.foo_id) and (table2.c.bar_id == table3.c.bar_id)))

Howevver, the results were not correct.

What is the best way to produce the equivalent to the following SQL?

SELECT * FROM table1
INNER JOIN table2 ON table1.foo_id = table2.foo_id
INNER JOIN table3 ON table2.bar_id = table3.bar_id

Thanks in advance :)

--PLB




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to