0
我有以下一行代碼來查詢數據庫,該數據庫的值爲「ntd」以日期順序排序。使用多個值對數據庫查詢進行排序
public Cursor fetchAllReminders(String maybe) {
return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID,
NAME, START_DATE_TIME, NEXT_DATE_TIME, BILL_AMOUNT, OCC_AMOUNT, REF, NEXT_DATE_TIME_ACT, SUM_OCC, OCC_PERIOD, BIL_ACT, DATE_ACT, COUNTABLE, LAST, DDEBIT, ONE_OFF,ONE_OFF2 }, REF +"=?", new String[] { maybe }, null, null, "ntd", null);
}
我可以添加另一個值,因此它首先按布爾值排序,然後按日期值排序?
感謝
你甚至可以調整排序順序:some_boolean_stuff asc,ntd desc –