SQLiteDatabase - How to use where clause?

前端 未结 7 763
情歌与酒
情歌与酒 2021-02-09 02:57
public Cursor fetchTimetable() {
    return mDb.query(DATABASE_TABLE_TIMETABLE, new String[] {TIMETABLE_ROWID,    TIMETABLE_MODULECODE, TIMETABLE_MODULENAME, TIMETABLE_R         


        
7条回答
  •  滥情空心
    2021-02-09 03:17

    You can use Use this query:

    SQLiteDatabase db = this.getReadableDatabase();
    
    //Cursor cursorr = db.rawQuery(Query, null);
    
    Cursor cursorr =  db.rawQuery("select * from " + DATABASE_TABLE_EHS + " where " + TASK_ID + "='" + taskid + "'" , null);
    
        if (cursorr.moveToFirst()) 
       {
    
            do {
    
                // your code like get columns
    
                }
             while (cursorr.moveToNext());
        }
    }
    

提交回复
热议问题