CREATE PROCEDURE `INSERT_H5_USERS`(IN `start_fund_account` int,IN `end_fund_account` int)
BEGIN
declare i int;
set i = start_fund_account;
loop_example : loop
select concat('index -> ', i);
if i <= end_fund_account then
INSERT INTO `h5_user_list` (`user_id`, `account_flag`, `create_datetime`, `modi_datetime`)
VALUES (i, '0', NOW(),NOW());
end if;
IF i > end_fund_account then
leave loop_example;
END IF;
set i = i + 1;
end loop;
BEGIN
declare i int;
set i = start_fund_account;
loop_example : loop
select concat('index -> ', i);
if i <= end_fund_account then
INSERT INTO `h5_user_list` (`user_id`, `account_flag`, `create_datetime`, `modi_datetime`)
VALUES (i, '0', NOW(),NOW());
end if;
IF i > end_fund_account then
leave loop_example;
END IF;
set i = i + 1;
end loop;
END
;
调用:call INSERT_H5_USERS(10000001,10000050);