mysql insert插入的3种方法

 

测试表student的字段

1.插入一条数据

INSERT INTO student(sid,sname,sage,ssex) VALUES(1,"wangdali",18,0);

2.插入多条数据

INSERT INTO student(sid,sname,sage,ssex) VALUES(2,"wangmeili",18,1) , (3,"lida",18,1);

3. 插入三条数据

INSERT INTO student SELECT 4,"zhangsan",19,1 UNION ALL
                                    SELECT 5,"zhaodade",19,1 UNION ALL
                                    SELECT 6,"nali",19,0;

 

posted @ 2019-04-24 15:12  米 立  阅读(1570)  评论(0编辑  收藏  举报