as the title states:
I have a select query, which I\'m trying to \"order by\" a field which contains numbers, the thing is this numbers are really strings starting w
Thanks to Skinnynerd. with Kotlin, CAST worked as follows: CAST fix the problems of prioritizing 9 over 10 OR 22 over 206.
define global variable to alter later on demand, and then plug it in the query:
var SortOrder:String?=null
to alter the order use:
For descendant:
SortOrder = "CAST(MyNumber AS INTEGER)" + " DESC"
(from highest to lowest)
For ascending:
SortOrder = "CAST(MyNumber AS INTEGER)" + " ASC"
(from lowest to highest)