android - 我们可以在 android sqlite 中使用截断查询吗

标签 android database sqlite

我们可以在 android 数据库中使用截断查询吗? 否则我们可以使用我们的 java 代码执行截断操作吗?

最佳答案

如果我必须截断一个表,我只需删除并重新创建它。

文档(http://www.sqlite.org/lang_delete.html):

When the WHERE is omitted from a DELETE statement and the table being deleted has no triggers, SQLite uses an optimization to erase the entire table content without having to visit each row of the table individually. This "truncate" optimization makes the delete run much faster.

关于android - 我们可以在 android sqlite 中使用截断查询吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3520088/

相关文章:

android - 旋转后, Sprite 和矩形位置在 Libgdx 中未对齐

android - 错误 :Execution failed for task ':app:dexDebug' . Parse.com

python - 用于大型(r)数据集的 Pandas

javascript - Mysql 查询结果没有给我正确的结果

mysql - MySQL/MariaDB 的匿名只读访问

Android - 单击状态栏中的通知将 Intent 与目标 Activity 绑定(bind)

javascript - 在 PhoneGap for Android 上捕获返回键

database - 具有某些特定条件的 ER 图

android - Helper.getWritableDatabase() 函数

Python sqlite3 构建带有动态占位符的部分