Re: [sqlalchemy] Left join and nested inner join

2023-07-05 Thread Michael Ekoka
Thanks, it worked. On Monday, July 3, 2023 at 8:49:58 PM UTC+7 Mike Bayer wrote: > use the join construct directly > > from sqlalchemy.orm import join > > > stmt = select(A).outerjoin(join(B, C), A.id == B.a_id) > > > > On Mon, Jul 3, 2023, at 8:29 AM, Michael Ekoka wrote: > > > Hi, I'm looking f

Re: [sqlalchemy] Left join and nested inner join

2023-07-03 Thread Mike Bayer
use the join construct directly from sqlalchemy.orm import join stmt = select(A).outerjoin(join(B, C), A.id == B.a_id) On Mon, Jul 3, 2023, at 8:29 AM, Michael Ekoka wrote: > > Hi, I'm looking for the SQLAlchemy equivalent to the query > > SELECT * > FROM a > LEFT OUTER JOIN (b INNER JOIN

[sqlalchemy] Left join and nested inner join

2023-07-03 Thread Michael Ekoka
Hi, I'm looking for the SQLAlchemy equivalent to the query SELECT * FROM a LEFT OUTER JOIN (b INNER JOIN c ON b.id = c.b_id) ON a.id = b.a_id Related: https://stackoverflow.com/a/56815807/56974 https://stackoverflow.com/questions/25514160/nested-joins-in-sqlalchemy Table "b" and "c" are joi