Mysql 我能';t使用其他自动增量列在表中的列中插入大量行。

Mysql 我能';t使用其他自动增量列在表中的列中插入大量行。,mysql,sql,insert-into,Mysql,Sql,Insert Into,我得到了一个具有自动增量ID列的表,我想添加另一列,该列将从ID列复制数字(例如名为copied_ID),因此 想要有两个相同的colmun,其中一个是自动递增的。 我试过: 但我有: 如果要添加其他列,请执行以下操作: -- Add the column to the table, if necessary alter table my_table add column copied_id int; -- Update the table update my_table set

我得到了一个具有自动增量ID列的表,我想添加另一列,该列将从ID列复制数字(例如名为copied_ID),因此 想要有两个相同的colmun,其中一个是自动递增的。 我试过:

但我有:


如果要添加其他列,请执行以下操作:

-- Add the column to the table, if necessary
alter table my_table add column copied_id int; 

-- Update the table
update my_table 
    set copied_id = id;
insert
插入新行。您想添加一个新列

-- Add the column to the table, if necessary
alter table my_table add column copied_id int; 

-- Update the table
update my_table 
    set copied_id = id;