创建存储过程向表中循环添加数据
程序员文章站
2022-05-14 19:41:21
...
CREATE PROCEDURE dowhile() BEGIN DECLARE n int; set n=1; WHILE n=1000 do INSERT into hasindex(num) VALUES (n); set n=n1; END WHILE; END; CALL dowhile();
CREATE PROCEDURE dowhile()BEGIN
DECLARE n int;
set n=1;
WHILE n do
INSERT into hasindex(num) VALUES (n);
set n=n+1;
END WHILE;
END;
CALL dowhile();