Re: [sqlalchemy] Having problem with constructing "update ...from..." with sqlalchemy

2011-09-12 Thread george hu
Thanks Michael, that solves my problem. On Mon, Sep 12, 2011 at 3:18 PM, Michael Bayer wrote: > > On Sep 12, 2011, at 5:50 PM, Geo wrote: > > > I have a tested update ... from.. statement, like so: > > UPDATE...FROM syntax, which is non-standard, isn't built into SQLAlchemy > right now. You'

Re: [sqlalchemy] Having problem with constructing "update ...from..." with sqlalchemy

2011-09-12 Thread Michael Bayer
On Sep 12, 2011, at 5:50 PM, Geo wrote: > I have a tested update ... from.. statement, like so: UPDATE...FROM syntax, which is non-standard, isn't built into SQLAlchemy right now. You'd need to either convert this to use a correlated SELECT in the WHERE clause, stick to the SQL string, or

[sqlalchemy] Having problem with constructing "update ...from..." with sqlalchemy

2011-09-12 Thread Geo
I have a tested update ... from.. statement, like so: update distributors set lead_bonus = lead_bonus + a.sum_amt from ( select target_member as id, sum(amount) as sum_amt from bonus_gen_history where bonus_type=2 and sub_type=1 and source_member in (select i