[sqlalchemy] Re: Trying to join a session query to a union

2015-07-08 Thread Jonathan Vanasco
you probably need to modify the various objections with a `.select()` or `.subquery()` e.g: query_select = query.select() q = intersect.join(query_select, query_select.c.sid, intersect.c.sid) pay attention to the docs on what the various methods return. some return a selectable, others

[sqlalchemy] Re: Trying to join a session query to a union

2015-07-08 Thread Horcle
For the record, this should have a '==' for the join condition: q = intersect.join(query_select, query_select.c.sid == intersect.c.sid) On Wednesday, July 8, 2015 at 7:48:54 PM UTC-5, Horcle wrote: Weird, I had tried using the subquery() method earlier, but it didn't work. Not sure why, but

[sqlalchemy] Re: Trying to join a session query to a union

2015-07-08 Thread Horcle
Weird, I had tried using the subquery() method earlier, but it didn't work. Not sure why, but now it is returning the desired query object. (I guess stepping away from this for a few hours was a good idea, eh?!) Thanks! Greg-- On Wednesday, July 8, 2015 at 6:24:16 PM UTC-5, Jonathan Vanasco