mysql - INSERT auto_increment value -
i have simple table few values , primary key auto_incremented 1:
create table test1 (acounter int not null primary key, studentid int not null, ranking int not null, aweek date not null); alter table test1 auto_increment=1;
if able insert test1 (null,1012,1,'2015-04-20')
, data comes in different order tried insert test1 (acounter,aweek,ranking,studentid) values (null,'2015-04-20',1,1012)
- receive error primary key cannot null. don't want - expect auto_increment use next value.
when declared column auto increment ,db take of insert other values table.
insert test1 (aweek,ranking,studentid) values ('2015-04-20',1,1012)
Comments
Post a Comment