我有一個數據庫,其中有一列以毫秒爲單位的日期。我試圖執行一個查詢,它允許我僅檢索大於當前系統時間並按升序排列的日期。Android原始查詢問題
這就是我所做的,但它似乎沒有工作,幫助將是最感激。
long lowestDate = 0;
long currentTime = System.currentTimeMillis();
String CT = Long.toString(currentTime);
String[] args = {CT};
mDb = mDbHelper.getReadableDatabase();
String mySQL = " select dt"
+ " from reminders"
+ " where dt > " + args[0]
+ " orderby dt Asc ";
Cursor c1 = mDb.rawQuery(mySQL, null);
以什麼方式不起作用?它是否崩潰,你是否收到錯誤信息,結果不是你期望的結果? –