In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
First of all, please give up alter.
The official explanation of sqlite is as follows:
SQLite supports a limited subset of ALTER TABLE. The ALTER TABLE command in SQLite allows the user to rename a table or to add a new column to an existing table. It is not possible to rename a column, remove a column, or add or remove constraints from a table.
It probably means that the alter function of sqlite is only a subset of alter table, with only some functions, such as renaming table names and adding columns to existing tables.
Renaming, deletion, and modification of existing columns are not supported.
After checking more than N data, it seems that it can only be done through an indirect way, whether renaming the column or deleting the column.
For example, the name of the table you want to modify is A, and the steps are as follows:
1. Create a new temporary table T, which has the same column as Table A.
two。 Insert all the data in An into T through insert statements.
3. Delete Table A
4. Create a new table A, when the column name of table An is the result you want, what you want to modify the column name, then define it as what you want to delete, then do not define it at the time of definition.
5. Restore the data, insert the data into A through the insert statement, the structure is insert into A select. From tablen T
6. Delete temporary table T.
On how to delete SQLite, modify, rename list to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.