Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the mysql loop

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report