DELIMITER $$
DROP PROCEDURE IF EXISTS insertFK $$
CREATE PROCEDURE `test`.`insertFK`()
BEGIN
DECLARE i INTEGER;
SET i=591;
WHILE i <=654 DO
BEGIN
INSERT INTO userinfo_has_role VALUES( (SELECT userInfoId FROM userinfo WHERE userInfoId=i) , '200002');
SET I=I+1;
END;
END WHILE;
END$$
DELIMITER ;
一个简单的Mysql 遍历
最新推荐文章于 2023-09-17 00:40:50 发布