数据库
首页 > 数据库> > mysql while 循环

mysql while 循环

作者:互联网

DELIMITER $$
CREATE PROCEDURE pro_insert(IN maxNum INT) 
BEGIN 
    DECLARE i INT DEFAULT(1);
    
    while i<=maxNum DO
        INSERT INTO employees (first_name ,last_name) VALUES ("z",CONCAT("sc",i));
        SET i=i+1;
        
        END WHILE;
END $$

DELIMITER ;


CALL pro_insert(20);

标签:insert,BEGIN,maxNum,INT,CREATE,while,循环,mysql
来源: https://www.cnblogs.com/lkj371/p/15038076.html