我想写一个Query来从表中删除一行.我很困惑写这个陈述.写这篇文章我需要一些帮助.我在这里用简单的sql语句提供我的要求.
(伪代码)
delete from tablename where value =="string1" && value2 == "string2" && value3 == "string3";
Run Code Online (Sandbox Code Playgroud)
我想在Android的Sqlite语法中写这个db.delete(tablename, whereclause, whereargs);.
我很感谢你的帮助.
Dan*_*y Y 28
更好的方法是使用
String where = "value1 = ?"
+ " AND value2 = ?"
+ " AND value3 = ?";
String[] whereArgs = {string1,string2,string3};
Run Code Online (Sandbox Code Playgroud)
use*_*211 16
String table_name = "myTable";
String where = "value1 = 'string1'"
+ " AND value2 = 'string2'"
+ " AND value3 = 'string3'";
String whereArgs = null;
mDb.delete(table_name, where, whereArgs);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
27131 次 |
| 最近记录: |