delimiter %%
CREATE PROCEDURE add_age()
BEGIN
DECLARE i INT;
set i =0;
WHILE i<1000000 DO
INSERT INTO stu_test (name,age) VALUES (i,i);
SET i= i+1;
END WHILE;
END
%%
CALL add_age();
这里是存储过程
delimiter %%
CREATE PROCEDURE add_age()
BEGIN
DECLARE i INT;
set i =0;
WHILE i<1000000 DO
INSERT INTO stu_test (name,age) VALUES (i,i);
SET i= i+1;
END WHILE;
END
%%
CALL add_age();
这里是存储过程