drop procedure if exists std2020;
delimiter //
CREATE PROCEDURE std2020()
begin
DECLARE ii int;
DECLARE rnd int;
DECLARE c int default 0;
set ii=0;
while ii <2020 DO
set rnd=FLOOR(10000 + (RAND() * 89999));
select count(id) into c from students where mobile = rnd;
if c>0 then
set ii=ii;
else
insert into ebk_students (nickname,email,mobile,password,create_time,extend_type) values('Test',CONCAT(rnd,"@test.com"),rnd,'12345',1437011608,1);
set ii=ii+1;
end if;
end while;
end//
call std2020();
delimiter //
CREATE PROCEDURE std2020()
begin
DECLARE ii int;
DECLARE rnd int;
DECLARE c int default 0;
set ii=0;
while ii <2020 DO
set rnd=FLOOR(10000 + (RAND() * 89999));
select count(id) into c from students where mobile = rnd;
if c>0 then
set ii=ii;
else
insert into ebk_students (nickname,email,mobile,password,create_time,extend_type) values('Test',CONCAT(rnd,"@test.com"),rnd,'12345',1437011608,1);
set ii=ii+1;
end if;
end while;
end//
call std2020();