create procedure loop_insert_resume0(in x int)
begin
declare max_id int;
declare i int;
set i = 0;
select max(id) into max_id from `TABLE`;
while i < x do
set i = i + 1;
insert into `TABLE` (`FIELD1`, `FIELD2`, `id`)
select `FIELD1`, `FIELD2`, (max_id+i) from `TABLE` where `resume_id` = max_id;
end while;
end
//
call loop_insert_resume0(50000);
0 comments:
댓글 쓰기