Re: [sqlalchemy] How can I filter (WHERE) on the results of a chained Selectable?

2017-01-02 Thread Thomas Vial
That makes sense. I was assuming that the WHERE clause with reference to expr.columns would involve some subquery magic, but granted, this is not easy to do in the general case (especially considering that with dotted composition the evaluation is done backwards ;-)). Thanks for your proposition;

Re: [sqlalchemy] How can I filter (WHERE) on the results of a chained Selectable?

2017-01-02 Thread mike bayer
On 01/02/2017 11:14 AM, tvial wrote: Hi and a happy new year to all :) I am having trouble applying a WHERE clause to a chained SELECT expression, by referencing the columns of the expression itself. Hard to put in words, it's better to give an example: | fromsqlalchemy importcreate_engine fr

[sqlalchemy] How can I filter (WHERE) on the results of a chained Selectable?

2017-01-02 Thread tvial
Hi and a happy new year to all :) I am having trouble applying a WHERE clause to a chained SELECT expression, by referencing the columns of the expression itself. Hard to put in words, it's better to give an example: from sqlalchemy import create_engine from sqlalchemy import Table, Column, Int