假设我有一个User带有字段popularity和date_created. 我想做以下查询:
SELECT * FROM user ORDER BY popularity DESC, date_created DESC LIMIT 10
在 SQLAlchemy 中,对于一个这样的工作:
User.query.order_by(User.popularity.desc()).limit(10).all()
我应该添加另一个order_by()吗?或者把两者都popularity放在date_created我的电流中order_by()?
我想popularity优先date_created订购。