我有一个表“TABLE_QUESTION”。我需要通过传递 exam_id 和 question_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);
答案 0 :(得分:4)
在examId + "
必须examId + " '
String selectQuery=("select * from question where exam_id ='" + examId + "' and question_id ='" + questionId +"'" );