Re: [sqlalchemy] Selecting across columns with func.min()

2013-08-20 Thread Michael Bayer
you have to consider that more than one row can have that same close, so it's a set of rows corresponding to that one close. so to remain in terms of sets you need to use a join (or a subquery): select prices.date from prices, (select min(price.close) as close from prices join company on

[sqlalchemy] Selecting across columns with func.min()

2013-08-19 Thread csdrane
Hi all, I've searched through the documentation and google on this and haven't been able to find an answer. I have the following class: class Price(Base): __tablename__ = prices id = Column(Integer, primary_key = True) company_id = Column(Integer, ForeignKey('companies.id'))