概述
1.傻傻的insert
INSERT INTO raw_materials.common_picture_setting
(PICTURE_SETTING_NAME,PICTURE_SETTING_URL,PICTURE_SETTING_TYPE,PICTURE_SETTING_ENABLED,PICTURE_SETTING_EXPLAIN,PLATFORM_TYPE)
VALUES
('LOGO-v3','https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike150%2C5%2C5%2C150%2C50/sign=5ad4d0a4c5bf6c81e33a24badd57da50/9345d688d43f879462947ce2db1b0ef41ad53a96.jpg',2,1,'广告位轮播图5张(默认图)',NULL),
('LOGO-v3','https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike150%2C5%2C5%2C150%2C50/sign=5ad4d0a4c5bf6c81e33a24badd57da50/9345d688d43f879462947ce2db1b0ef41ad53a96.jpg',2,1,'广告位轮播图5张(默认图)',NULL),
('LOGO-v3','https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike150%2C5%2C5%2C150%2C50/sign=5ad4d0a4c5bf6c81e33a24badd57da50/9345d688d43f879462947ce2db1b0ef41ad53a96.jpg',2,1,'广告位轮播图5张(默认图)',NULL),
('LOGO-v3','https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike150%2C5%2C5%2C150%2C50/sign=5ad4d0a4c5bf6c81e33a24badd57da50/9345d688d43f879462947ce2db1b0ef41ad53a96.jpg',2,1,'广告位轮播图5张(默认图)',NULL),
('LOGO-v3','https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike150%2C5%2C5%2C150%2C50/sign=5ad4d0a4c5bf6c81e33a24badd57da50/9345d688d43f879462947ce2db1b0ef41ad53a96.jpg',2,1,'广告位轮播图5张(默认图)',NULL),
('LOGO-v3','https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike150%2C5%2C5%2C150%2C50/sign=5ad4d0a4c5bf6c81e33a24badd57da50/9345d688d43f879462947ce2db1b0ef41ad53a96.jpg',2,1,'广告位轮播图5张(默认图)',NULL)
2.使用一个存储过程
DELIMITER //
CREATE PROCEDURE INIT_DEMO300_DATA()
BEGIN
DECLARE n int DEFAULT 0;
WHILE(n<=300) DO
INSERT INTO raw_materials.common_picture_setting
(PICTURE_SETTING_NAME,PICTURE_SETTING_URL,PICTURE_SETTING_TYPE,PICTURE_SETTING_ENABLED,PICTURE_SETTING_EXPLAIN,PLATFORM_TYPE)
VALUES
('LOGO-v3','https://gss2.bdstatic.com/-fo3dSag_xI4khGkpoWK1HF6hhy/baike/c0%3Dbaike150%2C5%2C5%2C150%2C50/sign=5ad4d0a4c5bf6c81e33a24badd57da50/9345d688d43f879462947ce2db1b0ef41ad53a96.jpg',2,1,'广告位轮播图5张(默认图)',NULL);
set n = n + 1;
END WHILE;
END //
DELIMITER ;
call INIT_DEMO300_DATA();
最后
以上就是畅快小蜜蜂为你收集整理的mysql一次插入多条demo测试用数据的全部内容,希望文章能够帮你解决mysql一次插入多条demo测试用数据所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复