测试的时候造数据,写个过程保存一下~

DELIMITER ;; 
CREATE PROCEDURE test2_insert()
BEGIN
	DECLARE
		i INT DEFAULT 1 ;
	WHILE i < 100 DO
		INSERT INTO users(
			nick_name,
			account,
			mobile,
			PASSWORD,
			created_at
		)
	VALUES
		(
			'1212',
			i,
			i,
			'1212',
			DATE_ADD('2018-07-01',INTERVAL i DAY )
		);
	SET i = i + 1 ;
	END
	WHILE ; COMMIT ;
	END;;

CALL test2_insert();

 

你可能感兴趣的:(MYSQL)