我只希望表格数据库中的选定值取决于i和j?
public Cursor getAll() {
int i=2;j=1;
return (getReadableDatabase().rawQuery(
"SELECT _id,note,answer From Notes where _id=? AND note=?",new String[]{i+""},new String[]{j+""}));
}
答案 0 :(得分:0)
试试这个。
public Cursor getAll() {
int i=2;
return (getReadableDatabase().rawQuery(
"SELECT _id,note,answer From Notes where _id=? ",new String[]{i+""}));
}
对于多个参数......
public Cursor getAll() {
int i=2;j=1;
return (getReadableDatabase().rawQuery(
"SELECT _id,note,answer From Notes where _id=? AND note=?",new String[]{i+"", j+""}));
}