mysql insert插入的3種方法

 

測試表student的字段測試

1.插入一條數據blog

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

2.插入多條數據數據

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

3. 插入三條數據img

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

相關文章
相關標籤/搜索