MySQL数据库:

INSERT INTO STUDENT (SNAME, SSEX, SAGE, SDEPT) SELECT '武耀旭','男',24,'CS' UNION SELECT '张志鹏','男',24,'CS' UNION SELECT '朱文辉','男',24,'CS' 
INSERT DELAYED INTO `newsort` (`sort_id`, `sort_name`, `sort_bz`) VALUES 
(1, 'aas', 'sdsdfsdfsf'), 
(2, 'ffff', 'gggg'), 
(4, '生活类', '要懂得生活才好!'), 
(5, '股票行情', ''), 
(6, '政治类新闻', ''), 
(7, 'IT行业新闻', ''), 
(8, '宗教类新闻', '');

oracle数据库:

两种插入方式 
INSERT INTO sc(SID,cid,g) VALUES (2011001,001,90); 
INSERT INTO sc(SID,cid,g) VALUES (2011002,001,91); 
INSERT INTO sc(SID,cid,g) VALUES (2011003,001,92); 
INSERT INTO sc(SID,cid,g) VALUES (2011004,002,93); 
INSERT INTO sc(SID,cid,g) VALUES (2011005,002,94); 
INSERT INTO sc(SID,cid,g) VALUES (2011006,002,95); 
INSERT INTO sc(SID,cid,g) VALUES (2011007,003,96); 
INSERT INTO sc(SID,cid,g) VALUES (2011008,003,97); 
INSERT INTO sc(SID,cid,g) VALUES (2011009,004,98); 
INSERT INTO sc(SID,cid,g) VALUES (2011010,004,99); 
INSERT INTO sc(SID,cid,g) 
SELECT 2011001,001,90 FROM dual UNION ALL  
SELECT 2011002,001,91 FROM dual UNION ALL  
SELECT 2011003,001,92 FROM dual UNION ALL  
SELECT 2011004,002,93 FROM dual UNION ALL  
SELECT 2011005,002,94 FROM dual UNION ALL  
SELECT 2011006,002,95 FROM dual UNION ALL  
SELECT 2011007,003,96 FROM dual UNION ALL  
SELECT 2011008,003,97 FROM dual UNION ALL  
SELECT 2011009,004,98 FROM dual UNION ALL  
SELECT 2011010,004,99 FROM dual 
发布评论

分享到:

IT虾米网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

insert into values插入多条数据详解
你是第一个吃螃蟹的人
发表评论

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。