mysql循环

DROP PROCEDURE test_insert ;
DELIMITER ;;
CREATE PROCEDURE test_insert ()
begin

declare nid int;
set nid=1;
while nid<23 DO


set nid=nid+1;
end while;
end;;

-- 调用和创建存储过程,分两步执行
call test_insert ();

你可能感兴趣的:(mysql循环)