MySQL Forums
Forum List  »  Newbie

Alternate to sequence
Posted by: kaji Pasa
Date: January 30, 2018 03:20PM

I created a table with id as auto increment
create table JUNK_1(
id int not null auto_increment,
standartTitle varchar(4000),
title varchar(4000),
SSID varchar(4000),
title_id int(11),
`Database` varchar(255),
databaseid varchar(255),
provider varchar(255),
providerid varchar(255),
CONSTRAINT ID_PK PRIMARY KEY (ID)
);

Now i want to populate this table with record from other table but id should be sequential like 1,2... and rest of the columns from other table


INSERT into junk_1
select standardtitle,title,ssid,title_id,`database`,databaseid,provider,providerid from holdings_parts_jeff;
As we dont have sequence in mysql, how do i use the sequential id during the insert in junk_1 table

Options: ReplyQuote


Subject
Written By
Posted
Alternate to sequence
January 30, 2018 03:20PM
January 30, 2018 04:52PM


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.