您好我的应用程序中我想只删除具有相同年份和月份的行:
按月删除行:
public void deleteMonth(int month){
open();
myDb.delete(TABLE_DAY, "month = ?", new String[] {month+""});
close();
}
但是为了按月和年删除行,它在这里崩溃是我试过的:
public void deleteMonth(int month ,int year){
open();
myDb.delete(TABLE_DAY, "month = ? , year = ?", new String[] {month+"",year+""});
close();
}
我解决了:
public void deleteMonth(int month ,int year){
open();
myDb.delete(TABLE_DAY, "month = ? and year = ?", new String[] {month+"",year+""});
close();
}