How to select min and max from table by column score?

后端 未结 2 1704
既然无缘
既然无缘 2021-02-13 05:23

How to select min and max from table by column score ? Is this possible with session query ?

class Player(Base):
    username = Column(String)
    score = Column         


        
2条回答
  •  有刺的猬
    2021-02-13 05:54

    from sqlalchemy import func
    max = session.query(func.max(Table.column)).scalar()
    min = session.query(func.min(Table.column)).scalar()
    

提交回复
热议问题