I am having a code for retrieving data like this. I wanted to get records with the dates in the ascending order.I tried using "KEY_DATE_TIME ASC" . but it didnt work.
我有一个代码来检索这样的数据。我想按升序获取日期记录。我尝试使用“KEY_DATE_TIME ASC”。但它没有用。
public Cursor fetchAllReminders() {
return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE,
KEY_BODY, KEY_PHONE,KEY_DATE_TIME}, null, null, null, null, null);
}
41
Assuming that KEY_DATE_TIME is a String constant holding the name of the db field, the following should work:
假设KEY_DATE_TIME是一个包含db字段名称的String常量,则以下内容应该有效:
return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_TITLE,
KEY_BODY, KEY_PHONE,KEY_DATE_TIME}, null, null, null, null, KEY_DATE_TIME + " ASC");
本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2011/11/08/534e761b5620a730f2f8d1b7f2e5d2e0.html。