mysql order by, null first, and DESC after

前端 未结 2 1604
旧巷少年郎
旧巷少年郎 2020-12-04 14:58

How can I order DESC by a field, but list the NULL values first?

So I\'m having a table:

reuestId | offerId | offerTitle
1        | 1       | Alfa
NU         


        
2条回答
  •  感动是毒
    2020-12-04 15:47

    Try this:

    ORDER BY [reuestId] IS NULL DESC, [reuestId] DESC
    

    should work (for mySql)

提交回复
热议问题