8.33. SQLAlchemy Query Limit
First
Last
Limit
Offset
Slice
8.33.1. First
>>> results = Valuation.query.filter_by(..).order_by(sqlalchemy.desc(Valuation.date)).first()
8.33.2. Last
No last method
>>> results = Valuation.query.filter_by(..).order_by(sqlalchemy.desc(Valuation.date)).all()
>>> first_valuation = results[0]
>>> last_valuation = results[-1]