Re: [sqlalchemy] how to add an order column to an existing table

2014-10-13 Thread Michael Bayer
perly ended" > I'm unfamiliar with this syntax (update ... from ... where). Was this > properly constructed? > > > From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On > Behalf Of Michael Bayer > Sent: Monday, October 13, 2014 8:53 PM >

Re: [sqlalchemy] how to add an order column to an existing table

2014-10-13 Thread Michael Bayer
... from ... where). Was this > properly constructed? > > > From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On > Behalf Of Michael Bayer > Sent: Monday, October 13, 2014 8:53 PM > To: sqlalchemy@googlegroups.com > Subject: Re: [sqlalchemy] how

RE: [sqlalchemy] how to add an order column to an existing table

2014-10-13 Thread Ofir Herzas
Subject: Re: [sqlalchemy] how to add an order column to an existing table in Oracle I'd update the table based on a SELECT from a window function: SELECT row number OVER (PARTITION BY employee_id ORDER BY id) FROM employee that should give you "1, 2, 3, ." for each row with

Re: [sqlalchemy] how to add an order column to an existing table

2014-10-13 Thread Michael Bayer
in Oracle I'd update the table based on a SELECT from a window function: SELECT row number OVER (PARTITION BY employee_id ORDER BY id) FROM employee that should give you "1, 2, 3, ..." for each row within an employee id group On Oct 13, 2014, at 1:44 PM, Ofir Herzas wrote: > I have found a so

[sqlalchemy] how to add an order column to an existing table

2014-10-12 Thread Ofir Herzas
I have the following table: my_table = sa.sql.table('my_table', sa.Column('id', sa.BigInteger), sa.Column('employee_id', sa.BigInteger)) and I want to add a 'rank' column using alembic. The addition itself is pretty straight forward using add_column but I also need to populate that co