MySQL Forums
Forum List  »  General

Re: INSERT, UPDATE, REPLACE INTO alternate key
Posted by: Peter Brawley
Date: December 19, 2012 01:46PM

Yes, eg ...

drop table if exists tblbak, tblnew;
create table tblbak select * from tbl;
create table tblnew like tbl;
alter table tblnew add column id int unsigned primary key auto_increment first;
insert into tblnew(col1,col2,...) select * from tbl;
drop table tbl;
rename table tblnew to tbl;

Options: ReplyQuote


Subject
Written By
Posted
Re: INSERT, UPDATE, REPLACE INTO alternate key
December 19, 2012 01:46PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.