How to use the LIMIT argument in an SQLite Query with Android

后端 未结 1 985
滥情空心
滥情空心 2020-12-01 05:59

I am trying to use the following query to get the most recent result by date.

Cursor cursor = mDb.query(DATABASE_TABLE, new String[] {KEY_DATE, KEY_REPS, 
KE         


        
相关标签:
1条回答
  • 2020-12-01 06:42

    Order by id DESC Limit 1:

    db.query("table", null, "column=?", new String[]{"value"}, null, null, "id DESC", "1");
    
    0 讨论(0)
提交回复
热议问题