[sqlalchemy] datetime interval to a number..

2011-01-27 Thread Petra Clementson
hi all, I've been trying to work out some SQLalchemy code to query two datetime columns and choose the one closest in time. I have some code that does this, but it requires using PostgreSQL and looks a little messy: query = query.order_by(ABS(EXTRACT(EPOCH FROM (header.utdatetime -

Re: [sqlalchemy] datetime interval to a number..

2011-01-27 Thread Petra Clementson
, which is a standalone SQLA construct. from sqlalchemy import func, extract func.abs(extract('epoch', header.udatetime - self.header.udatetime)) On Jan 27, 2011, at 4:21 PM, Petra Clementson wrote: hi all, I've been trying to work out some SQLalchemy code to query two datetime

Re: [sqlalchemy] combining join with alias

2011-01-10 Thread Petra Clementson
On Sat, Jan 8, 2011 at 7:59 PM, Petra Clementson petraclement...@gmail.comwrote: On Sat, Jan 8, 2011 at 10:38 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Jan 8, 2011, at 3:23 PM, Petra Clementson wrote: I want to do a self join on combined but it wont let me. Essensially, I

[sqlalchemy] combining join with alias

2011-01-08 Thread Petra Clementson
I want to do a self join on combined but it wont let me. Essensially, I want to join two different tables, and create aliases so I can compare one column and make sure that each item in the column is uniqe. If there are duplicates, I want my piece of code to show the duplicates. Combining join

Re: [sqlalchemy] combining join with alias

2011-01-08 Thread Petra Clementson
On Sat, Jan 8, 2011 at 10:38 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Jan 8, 2011, at 3:23 PM, Petra Clementson wrote: I want to do a self join on combined but it wont let me. Essensially, I want to join two different tables, and create aliases so I can compare one column