📅  最后修改于: 2022-03-11 14:52:42.943000             🧑  作者: Mango
SQLiteDatabase db=this.getWritableDatabase();
ContentValues cv=new ContentValues();
cv.put("columName1",YOUR_VAR);
cv.put("columName2",YOUR_VAR);
cv.put("columName3",YOUR_VAR);
int response=db.update("YourTable",cv,"columName = ?"+ new String[]{YOUR_VAR})
if(response==0){
db.insert("Your_table",null,cv);
}