posted @ 2013-05-03 16:34 潘小博1992 阅读(231) 评论(0) 推荐(0)
摘要:        
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    阅读全文
        
                    
                
浙公网安备 33010602011771号