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);
上一篇:剧集数字兼容性显示


下一篇:7-8 点赞(需要继续改进)