On Mon, Jan 26, 2009 at 5:21 PM, Jon Nelson <jnel...@jamponi.net> wrote: ... If I start with this subquery:
> q0 = s.query(Account.accountid, > sa.func.count(User.userid).label('user_count')) > .join(Account.users) > .group_by(Account.accountid) > .having(sa.func.count(User.userid)>1) > .subquery() and build on it like this: s.query(Account) .join((q0, Account.accountid==q0.c.accountid)) .all() Then everything works. It leads me to a question: why do I need to explicitly list the join condition? -- Jon --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---