做了表后可以做一个字段AUTOINCREMENT吗?例如,如果您创建如下表格:
create table person(id integer primary key,name text);
后来才意识到需要自动递增。我如何解决它,即在你可以做的MysqL:
alter table person modify column id integer auto_increment
表格创建是唯一的机会来创建列AUTOINCREMENT?
您可以将内容转储到新表中:
原文链接:https://www.f2er.com/sqlite/197977.htmlCREATE TABLE Failed_banks_id (id integer primary key autoincrement,name text,city text,state text,zip integer,acquired_by text,close_date date,updated_date date); INSERT INTO Failed_banks_id(name,city,state,zip,acquired_by,close_date,updated_date) SELECT name,updated_date FROM Failed_banks;
并重命名表:
DROP TABLE Failed_banks; ALTER TABLE Failed_banks_id RENAME TO Failed_banks;