我对数据库中的数据进行倒序排序,比如A表中的b列。
select * from A order by b desc
如果b中存在空值,我可以以用nvl处理
如果在python中怎么办呢?
A.object.filter(id=id).order_by(-b)
我怎么处理这个空值呢?有没有类似的给b付空值的方法?请大神帮忙!!
By default, null values will be sorted first. If you have other needs, sorted in Python can specify a sorting function. You can just write a sorting function yourself.
By default, null values will be sorted first. If you have other needs,
sorted
in Python can specify a sorting function. You can just write a sorting function yourself.