从SQLite表中删除列

从SQLite表中删除列,第1张

概述我有一个问题:我需要从我的SQLite数据库中删除一个列。我写了这个查询 alter table table_name drop column column_name 但它不工作。请帮帮我。 来自: http://www.sqlite.org/faq.html: (11) How do I add or delete columns from an existing table in SQLite 我有一个问题:我需要从我的sqlite数据库中删除一个列。我写了这个查询
alter table table_name drop column column_name

但它不工作。请帮帮我。

来自: http://www.sqlite.org/faq.html:

(11) How do I add or delete columns from an existing table in sqlite.

sqlite has limited ALTER table support that you can use to add a
column to the end of a table or to change the name of a table. If you
want to make more complex changes in the structure of a table,you
will have to recreate the table. You can save existing data to a
temporary table,drop the old table,create the new table,then copy
the data back in from the temporary table.

For example,suppose you have a table named “t1” with columns names
“a”,“b”,and “c” and that you want to delete column “c” from this
table. The following steps illustrate how this Could be done:

06000

总结

以上是内存溢出为你收集整理的从SQLite表中删除列全部内容,希望文章能够帮你解决从SQLite表中删除列所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1163127.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存