Last active
July 2, 2019 08:56
-
-
Save dreamlu/0f4999b123ea4ccd82e268bb2f8d8ed9 to your computer and use it in GitHub Desktop.
批量插入百万数据,存储过程
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DEFINER=`root`@`localhost` PROCEDURE `database`.`name`() | |
BEGIN | |
DECLARE pre_name BIGINT; | |
DECLARE ageVal INT; | |
DECLARE i INT; | |
SET pre_name=862362681; | |
SET ageVal=100; | |
SET i=1; | |
WHILE i < 1000000 DO | |
INSERT shop(name,union_id, open_id) VALUES(CONCAT(pre_name,'@qq.com'),CONCAT(i ,'unionId'),CONCAT(i,'openId')); | |
SET pre_name=pre_name+100; | |
SET i=i+1; | |
END WHILE; | |
END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment