未闻花名已知花意:关于mysql操作的一个问题

来源:百度文库 编辑:高考问答 时间:2024/05/09 11:56:06
当我建立一个表
create table a(id int not null primary key auto_increment);
后, 我插入 insert into a value();
可以得到初始值1.
但是当我建立两个列
create table a(id int not null primary key auto_increment,
name varchar(29), not null);
后, 我插入 insert into a value( , 'aa');
就会返回错误, 这是为什么? 难道不能不给出id的值而让它初始化并且自加吗?

insert into (name) values ('aa');

ID..定义为自增型的..不能给予确定值...