rawQuery(query, selectionArgs)

后端 未结 7 1300
不思量自难忘°
不思量自难忘° 2020-11-30 22:32

I want to use select query for retrieving data from table. I have found, rawQuery(query, selectionArgs) method of SQLiteDatabase class to retrieve

7条回答
  •  鱼传尺愫
    2020-11-30 22:43

    Maybe this can help you

    Cursor c = db.rawQuery("query",null);
    int id[] = new int[c.getCount()];
    int i = 0;
    if (c.getCount() > 0) 
    {               
        c.moveToFirst();
        do {
            id[i] = c.getInt(c.getColumnIndex("field_name"));
            i++;
        } while (c.moveToNext());
        c.close();
    }
    

提交回复
热议问题