SQLAlchemy ORDER BY DESCENDING?

前端 未结 6 1861
迷失自我
迷失自我 2020-11-27 09:21

How can I use ORDER BY descending in a SQLAlchemy query like the following?

This query works, but returns them in ascending order:



        
6条回答
  •  旧时难觅i
    2020-11-27 09:50

    One other thing you might do is:

    .order_by("name desc")
    

    This will result in: ORDER BY name desc. The disadvantage here is the explicit column name used in order by.

提交回复
热议问题