mysql 批量循环插入数据

来源:互联网 发布:内网软件 编辑:程序博客网 时间:2024/05/22 08:26

目的

批量插入测试数据到表中;


表:



插入语句:


DELIMITER ;;  CREATE PROCEDURE test_insertsssc()  BEGIN    DECLARE i INT DEFAULT 10;# can not be 0    WHILE i<=1000  DO  insert into sign_guest values (i, CONCAT('张三',i) , CONCAT('130000000',i),CONCAT('130000000',i,'@u.com'), 1, '2017-09-04 05:45:53.132367',1);  SET i=i+1;  END WHILE ;  commit;    END;;    CALL test_insertsssc();



插入成功:



原创粉丝点击