I'm a newbie in SQLAlchemy and haven't got much chance to deal with subqueries. I'm using Flask SQLAlchemy, for the record.
Below is the first part of the query:
Team.query.filter(Team.season_id==12610)
Below is the part I'd like to query the first part with: (If that is even possible)
Team.query.order_by(desc(Team.team_rank))
Basically, after filtering from a certain season_id
, I want to to order the teams by team_rank
.
Thanks in advance!
You're almost there! Just chain the commands.
from sqlalchemy import desc
Team.query.filter(Team.season_id == 12610).order_by(desc(Team.team_rank))
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments