MySQL数据库表中有自增主键ID,当用SQL插入语句中插入语句带有ID列值记录的时候;
具体:
1.创建数据库
create table if not exists userInfo (id int PRIMARY KEY AUTO_INCREMENT,name varchar(50) NOT NULL,password varchar(50) NOT NULL);
2.插入数据记录
insert into userInfo values(1,'aaa','1212');
#方法①:insert into userInfo values(null,'ddf','8979');insert into userInfo values(0,'ddf','8979');
#方法②:insert into userInfo(name,password) values('ddf','8979');
联系客服