DROP PROCEDURE IF EXISTS my_insert;
CREATE PROCEDURE my_insert()
BEGIN
DECLARE n int DEFAULT 1;
loopname:LOOP
INSERT INTO dd_test(title)VALUES(n);
SET n=n+1;
IF n=100000 THEN
LEAVE loopname;
END IF;
END LOOP loopname;
END;
CALL my_insert();
MySQL 新建查询快速插入10万条数据DROP PROCEDURE IF EXISTS my_insert;CREATE PROCEDURE my_insert()BEGIN DECLARE n int DEFAULT 1; loopname:LOOP INSERT INTO dd_test(title)VALUES(n); SET n=n+1; IF n=100000 THEN LEAVE