make zero appear last in a list of ascending numbers

后端 未结 5 1250
悲哀的现实
悲哀的现实 2020-12-19 22:06

I\'m using SQLite in an Android application.
In all of my tables I have a default row with an index of 0 that holds default values for that table.
In most situations

5条回答
  •  爱一瞬间的悲伤
    2020-12-19 22:44

    order by decode(epoch_date.epoch,0,null,epoch_date.epoch)

    you can use something like this..since nulls are kept in the end in case of ascending order. provided you have decode function available in sqlite..or else you can just use a case statement instead.

    Ravi Kumar

提交回复
热议问题