How to use the mysql loop
Let's learn how to use the mysql loop. I believe you will benefit a lot after reading it. There are not many words in the text. I hope how the mysql loop uses this short content is what you want.
While for example
DROP PROCEDURE IF EXISTS zy.test_pro
DELIMITER $$
CREATE PROCEDURE zy.test_pro (IN id INT)
BEGIN
DECLARE num INT
SET num=1
WHILE num = 20 end repeat;end / /-call call looppc ()
Loop
Delimiter $$drop procedure if exists lopp;create procedure lopp () begin declare i int; set I = 1 * * LP1: LOOP / / lp1 is the loop body name LOOP is the keyword insert into user_profile (uid) values (I); set I = icycle 1; if I > 30 then leave lp1; / / leave the loop body end if
End LOOP; / / end cycle end $$
After reading this article on how to use the mysql cycle, many readers will want to know more about it. For more industry information, you can follow our industry information section.