关于ALTER方法sql解释如下:
首先:sqlite的ALTER的操作是sql标准ALTER操作的字迹,它只含义RENAME TABLE和ADD COLUMN。(奇葩的是我用旧版本的sqlite Expert Professional,识别不了RENAME TABLE)。
(Only the RENAME TABLE and ADD COLUMN variants of the ALTER TABLE command are supported. Other kinds of ALTER TABLE operations such as DROP COLUMN,ALTER COLUMN,ADD CONSTRAINT,and so forth are omitted)
更改列属性操作就是
1.新建期望的表结构的表,命名为A_new
CREATE TABLEA (...
2.将A_new数据插入A
INSERT INTO A SELECT ... FROM A_new
3.删除A_cache
DROP TABLE X.
4.重命名表A_new
ALTER TABLE A_new RENAME TO A