这是我发现的一个简短片段:
This is a short snippet I found:
"删除数据
一旦不再需要数据,可以使用以下命令将其从数据库中删除删除()方法.delete() 方法需要 3 个参数,数据库名称、WHERE 子句和 WHERE 的参数数组条款.要从表中删除所有记录,请为 WHERE 传递 null子句和 WHERE 子句参数数组.
Once data is no longer needed it can be removed from the database with the delete() method. The delete() method expects 3 parameters, the database name, a WHERE clause, and an argument array for the WHERE clause. To delete all records from a table pass null for the WHERE clause and WHERE clause argument array.
db.delete("tbl_states", "id=?", new String[] {Long.toString(countryId)});
db.delete("tbl_states", "id=?", new String[] {Long.toString(countryId)});
只需调用 delete() 方法即可从 SQLite 数据库中删除记录.delete 方法需要表名和可选的where 子句和 where 子句参数替换数组为参数.where 子句和参数替换数组只工作与更新在哪里?由数组中的值替换."
Simply call the delete() method to remove records from the SQLite database. The delete method expects, the table name, and optionally a where clause and where clause argument replacement arrays as parameters. The where clause and argument replacement array work just as with update where ? is replaced by the values in the array."
像往常一样,我找不到关于以下内容的简单文档:
As usual I cannot find simple documentation as to:
将 null 传递给 WHERE 子句和参数数组将删除所有内容(想想如果没有 WHERE 子句你所说的是从 tbl_states 中删除).
Passing in null to the WHERE clause and argument array will delete everything (think if there is no WHERE clause all you are saying is delete from tbl_states).
delete 以整数形式返回删除的行数.
delete returns the number of rows deleted as an integer.
更多推荐
Android SQLite delete() 全部并返回值
发布评论