我正在尝试按对象排序对象列表'日期,降序。日期在这个表格上:dd-MM-yyy。问题是10被解释为小于9.(我猜因为1小于9)。我怎么能绕过这个?现在我的订单看起来像这样:
虽然我希望它是这样的:
我没试过这两个选项:
String selectQuery = "SELECT * FROM " + TABLE_DIARY + " WHERE TreatmentId = " + treatment.getId() + " ORDER BY " + "substr(DATE,7)||substr(DATE,1,2)||substr(DATE,4,2) DESC";
String selectQuery = "SELECT * FROM " + TABLE_DIARY + " WHERE TreatmentId = " + treatment.getId() + " ORDER BY " + "DATE DESC";
String selectQuery = "SELECT * FROM " + TABLE_DIARY + " WHERE TreatmentId = " + treatment.getId() + " ORDER BY " + "date(DATE) DESC";
最后一个对它进行排序,但遗憾的是没有DESCENDING ......
我也尝试过这样做:SQLITE DB sort query by string formatted date field
它对它进行排序,但它并没有对它进行排序。