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();创建存储过程向表中循环添加数据,布布扣,bubuko.com
创建存储过程向表中循环添加数据
原文:http://blog.csdn.net/zhanyan_x/article/details/25327247