请找出这里有什么问题
这里 _id 和 chek 是我的数据库的列,我要编写一个查询来搜索那些具有 id =id 的列并检查 =number
public Cursor query(int id){
return myDataBase.query("question", null,"_id = "+id+ "AND " + "chek ="+number,null, null, null, null);
}
最佳答案
希望这对您有帮助:
用这些行替换您的查询..
public Cursor query(int id){
return myDataBase.query("question", null,"_id = "+id+ " AND " + "chek ="+number,null, null, null, null);
在 And :"And "
中的双引号之间保留空格,否则字符串将是
示例: _id=3And check =9
关于android - 使用 where 条件进行 Sqlite 查询需要满足多个条件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17803204/