CREATE PROCEDURE dowhile()
BEGIN
DECLARE n int;
set n=1;
WHILE n<=1000
do
INSERT into hasindex(num) VALUES (n);
set n=n+1;
END WHILE;
END;
CALL dowhile();
创建存储过程向表中循环添加数据
时间: 2024-12-19 04:03:42
CREATE PROCEDURE dowhile()
BEGIN
DECLARE n int;
set n=1;
WHILE n<=1000
do
INSERT into hasindex(num) VALUES (n);
set n=n+1;
END WHILE;
END;
CALL dowhile();
创建存储过程向表中循环添加数据