MySQL创建存储过程批量插入数据
作者:互联网
DROP PROCEDURE IF EXISTS test; CREATE PROCEDURE test() #创建存储函数; BEGIN DECLARE i INT DEFAULT 1; WHILE i < 20 DO INSERT INTO `t_test_auto`(`id`, `name`,`age`) VALUES ('1'+i,'haha',ROUND((7+RAND()*6),2)); SET i = i+1; end WHILE; END; CALL test();#调用存储函数
标签:存储,函数,批量,创建,插入,WHILE,MySQL,test,PROCEDURE 来源: https://www.cnblogs.com/xuyinshan/p/16203996.html