data type mismatch error when using ORDER BY

后端 未结 5 2096
天涯浪人
天涯浪人 2021-02-05 02:19

I\'ve got an android app using a local sqlite database.

private SQLiteDatabase mDb;

when I run this query I get my Cursor over rows with pid eq

5条回答
  •  半阙折子戏
    2021-02-05 02:53

    If I correctly understood your problem, try this.

        String[] columns = new String[] {KEY_PID, KEY_TID};
        String where = KEY_PID + " = " + Integer.toString(id);
        String orderBy = KEY_PID + " DESC";
    
        Cursor cursor = mDb.query(PT_TABLE, columns, where, null, null, null, orderBy);
    

提交回复
热议问题