摘要:
1、把主键定义为自动增长标识符类型MySql在mysql中,如果把表的主键设为auto_increment类型,数据库就会自动为主键赋值。例如:create table customers(id int auto_increment primary key not null, name varchar(15));insert into customers(name) values("name1"),("name2");select id from customers;以上sql语句先创建了customers表,然后插入两条记录,在插入时仅仅设定了name 阅读全文
posted @ 2013-10-20 12:13
北斗极星
阅读(550)
评论(0)
推荐(0)