mysql - How to Find Count After Join in SQLAlchemy -


i join multiple tables with:

session.query(r, rr, rrr).join(r).join(rr).all() 

i tried:

session.query(func.count(r, rr, rrr)).join(r).join(rr) 

however, not appear correct approach determining count tables.

i

len(session.query(r, rr, rrr).join(r).join(rr).all()) 

but ideally, won't have counts in memory.

if after count(*), below should work:

q = (session      .query(func.count().label("cnt"))      .select_from(r)      .join(rr)      .join(rrr)      ) r = q.scalar() 

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -