mysql 循环insert

亲测成功!可用,复制即可

 

DELIMITER ;;
CREATE PROCEDURE test_insert()
BEGIN
DECLARE y TINYINT DEFAULT 1;
WHILE y<10
DO
INSERT INTO sysuser_user_deposit_log(log_id, type, user_id, operator, fee, message, logtime, deposit) VALUES (NULL, 'expense', '4903', 'system', '0.500', '用户抽奖,抽奖单号:1807261600465829', '1532592017', NULL);
SET y=y+1;
END WHILE ;
commit;
END;;
CALL test_insert();

posted @ 2018-12-10 21:13  不必、放弃  阅读(4631)  评论(0编辑  收藏  举报