androidsql语句中的多Where子句
我对Android的SQL语句有一些问题。基本上我有两个where子句,bookID和userID,以及我现在拥有的SQL语句:androidsql语句中的多Where子句,android,sql,sqlite,where,Android,Sql,Sqlite,Where,我对Android的SQL语句有一些问题。基本上我有两个where子句,bookID和userID,以及我现在拥有的SQL语句: public boolean updateLoan(String bookID, String userID, String currentDate) { try { ContentValues cv = new ContentValues(); cv.put("loanDate", currentDate);
public boolean updateLoan(String bookID, String userID, String currentDate) {
try {
ContentValues cv = new ContentValues();
cv.put("loanDate", currentDate);
mDb.update("loanBook", cv,
" bookID= '" + bookID + "'", null);
return true;
} catch (Exception ex) {
Log.e(TAG, ex.toString());
return false;
}
}
所以我想知道如何在这个方法中放置两个where子句,因为目前我只能按bookID放置where子句。我是否简单地放置一个&并继续执行SQL语句
提前感谢。我是否只需放置一个&并继续SQL语句
是的,用和代替&对不起,我粗心的错误。谢谢!