[sqlalchemy] Re: order by before group by

2014-03-17 Thread Jonathan Herriott
Ok, I figured it out. stmt = session.query(Bill).filter_by(account_id=id).order_by(Bill.timestamp.desc()).subquery() session.query().add_entity(Bill, alias=stmt).group_by(Bill.date_begin) On Monday, March 17, 2014 7:44:09 PM UTC-7, Jonathan Herriott wrote: > > Hi, > > I was creati

[sqlalchemy] order by before group by

2014-03-17 Thread Jonathan Herriott
Hi, I was creating a billing table that needs to be updated on repeated cycles as more information becomes available for a month, so I was following an Add Only scheme where I only add new rows, so we can keep track of the history of the month. Now, when I show them a list of bills for the yea