Bootstrap

mysql实现for循环

DROP PROCEDURE
IF
	EXISTS test_insert;

DELIMITER;;
CREATE PROCEDURE test_insert ( ) BEGIN
DECLARE
		i INT DEFAULT 1;
	WHILE
			i < 100 DO
		SELECT
			123 AS 'name' 
			SET i = i + 1;
		
	END WHILE;
	COMMIT;
	
	END;;
CALL test_insert ( );
;