-1

我有一张桌子“TABLE_QUESTION”。我需要通过Exam_idquestion_Id来获取记录。我编写了一个查询来从表中获取记录,但它显示异常"SQLite Exception near question_id"

这是我的查询供您参考..

 String selectQuery=("select * from question where exam_id ='" + examId + " and question_id ='" + questionId +"'" );
        Cursor cursor = db.rawQuery(selectQuery, null);  
4

1 回答 1

4

你错过了一个单引号,examId + "必须是 examId + " '

String selectQuery=("select * from question where exam_id ='" + examId + "' and question_id ='" + questionId +"'" );
于 2012-04-07T06:20:19.293 回答