删除表中的所有值
在iPhone应用程序中,是否可以通过sqlite删除表中的所有值?如果是这样,那么查询它是什么?请帮帮我。
In an iPhone application, is it possible to delete all the values in a table through sqlite? If so, what is the query for it? Please help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设它使用标准 SQL,那就很简单:
其中 MYTABLE 是您要清除的表的名称。我知道在桌面上使用 SQLite3,您还可以随后运行真空操作来压缩数据库。我不能说这是否在 iPhone 上可用,但您应该调查一下,因为
删除
并不一定会释放任何空间。Assuming it uses standard SQL, that would simply be:
where
MYTABLE
is the name of the table you want to clear. I know with SQLite3 on the desktop you can also run a vacuum operation afterwards to compact the database. Whether that's available on the iPhone, I can't say, but you should investigate it since thedelete
doesn't necessarily free up any space.快速
DELETE FROM tablename
应该可以做到A quick
DELETE FROM tablename
should do it