mysql for循环存储过程
文章目录
DROP PROCEDURE IF EXISTS test_insert;
DELIMITER ;;
CREATE PROCEDURE test_insert ()
BEGIN
DECLARE i int;
set i=14;
WHILE i<30
DO
insert into student(name,age,nianji,phone) values(CONCAT('hh',i),CONCAT(i,''),'1','123');
SET i=i+1;
END WHILE ;
commit;
END;;
call test_insert () ;
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论