Reputation: 11
I want all the values of the first field(custId) of sql table to start with 100 such that the first value is 1001 up to 100n-1. my sample code is :
create table customer(custId int(25) primary key not null auto_increment,);
Upvotes: 1
Views: 1359
Reputation: 81
Once your create query is executed, alter the auto increment start value to 1000.
ALTER TABLE customer AUTO_INCREMENT=1001;
So the first record would have custId = 1001
Upvotes: 1
Reputation: 1529
Try with below query
Set the Auto increment value when create the table.
create table customer(custId int(25) primary key not null auto_increment,) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1001;
Upvotes: 2