SQLiteDatabase - How to use where clause?

前端 未结 7 760
情歌与酒
情歌与酒 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:13

    What exactly does "still doesn't work" mean?

    The following code should work just fine:

    public Cursor fetchTimetable() { 
        String[] columnNames = new String[] {TIMETABLE_ROWID, TIMETABLE_MODULECODE, TIMETABLE_MODULENAME, TIMETABLE_ROOM, TIMETABLE_LECTURER, TIMETABLE_TIME};
        String whereClause = "TIMETABLE_MODULECODE=123"; 
    
        return mDb.query(DATABASE_TABLE_TIMETABLE, columnNames, whereClause, null, null, null, null); 
    } 
    

提交回复
热议问题