DROP PROCEDURE test_insert ;
DELIMITER ;;#声明;;为结束标志
CREATE PROCEDURE test_insert ()
BEGIN
DECLARE i INT;
set i=0;
WHILE i<10
DO
INSERT INTO user
(
user_id,
user_name
)
VALUES
(
CONCAT('041431',i),
CONCAT('name',i)
);
SET i=i+1;
END WHILE ;
END;;
CALL test_insert();;
mysql数据库中循环插入
最新推荐文章于 2024-07-19 03:25:55 发布