Android 游标为何丢失sqlite的排序描述
我在sqlite中有一个查询Android 游标为何丢失sqlite的排序描述,android,sqlite,Android,Sqlite,我在sqlite中有一个查询 String[] args = { Report_DATETIME,Report_DATETIME, EMSUnitCode }; String sql = "Select * from TR_ReportingAll Where (Report_DATETIME<? or ( Report_DATETIME=? and EMSUnitCode!=?)) order by Report_DATETIME,EMSUnitCode DES
String[] args = { Report_DATETIME,Report_DATETIME, EMSUnitCode };
String sql = "Select * from TR_ReportingAll Where (Report_DATETIME<? or ( Report_DATETIME=? and EMSUnitCode!=?)) order by Report_DATETIME,EMSUnitCode DESC Limit 10";
mCursor = database.rawQuery(sql, args);
String[]args={Report\u DATETIME,Report\u DATETIME,EMSUnitCode};
String sql=“从TR_ReportingAll Where中选择*(Report_DATETIME您的排序标准是Report_DATETIME ASC
,然后,所有具有相同Report_DATETIME的项目都按EMSUnitCode DESC
进行排序DESC
不适用于所有ORDER by
字段,但只有您为其设置的字段和ASC
才是默认顺序。因此,如果您要将日期降序,请将您的顺序更改为按报告日期时间描述的顺序,EMSUnitCode DESC您的结果将首先按报告日期时间ASC
排序,然后按EMSUnitCode DESC
第二次排序