Re: [sqlalchemy] outerjoin condition matching tuples

2014-04-21 Thread Michael Bayer
no, the SQL is SELECT ... FROM x JOIN y ON x.a=y.a AND x.b=y.b AND x.c=y.c On Apr 21, 2014, at 9:02 AM, Rick Otten wrote: > Interesting, and I had thought about it, but wouldn't that run the subquery > (myselect) 3 times for each join? > > > On Sunday, April 20, 2014 10:01:20 PM UTC-4, Mich

Re: [sqlalchemy] outerjoin condition matching tuples

2014-04-21 Thread Rick Otten
Interesting, and I had thought about it, but wouldn't that run the subquery (myselect) 3 times for each join? On Sunday, April 20, 2014 10:01:20 PM UTC-4, Michael Bayer wrote: > > there’s a way to get the tuple comparison to work here though it’s not as > common, I’d have to try it out and the

Re: [sqlalchemy] outerjoin condition matching tuples

2014-04-20 Thread Michael Bayer
there's a way to get the tuple comparison to work here though it's not as common, I'd have to try it out and there might be some quirks to work out. I would think this would be more straightforward using a straight AND: and_(mo.c.col1 == myselect.c.col1, mo.c.col2 == myselect.c.col2, mo.c.col3 =

Re: [sqlalchemy] outerjoin where first selected column is a literal dies with confusing error

2014-03-17 Thread Michael Bayer
the error message has been improved in 9ec01ab35a / 987759aec51e (0.9 / 0.8) On Mar 17, 2014, at 4:16 PM, Michael Bayer wrote: > when you do outerjoin() it will try to join from the first item in the list, > unless you do select_from: > > query(literal(), X.foo, Y.bar).select_from(X).join(Y,

Re: [sqlalchemy] outerjoin where first selected column is a literal dies with confusing error

2014-03-17 Thread Michael Bayer
when you do outerjoin() it will try to join from the first item in the list, unless you do select_from: query(literal(), X.foo, Y.bar).select_from(X).join(Y, ) will see what can be done about the error message On Mar 17, 2014, at 2:58 PM, Ryan Kelly wrote: > Hi: > > When I run the atta

Re: [sqlalchemy] outerjoin

2011-01-26 Thread Michael Bayer
On Jan 26, 2011, at 11:46 AM, Pankaj wrote: > Hi, > > I have this subquery, which yields results > > sp_HeaderDetails = > session.query( InvoiceCashFlowPerDocNum.sequence_id, > InvoiceHeaderInfo.invoice_ref, InvoiceHeaderInfo.doc_num ) \ >.filter( ( InvoiceCashFlowPerDocNum