create PROCEDURE bathInsertData()
BEGIN
DECLARE i int DEFAULT 0;
while i<100000 DO
set i=i+1;
delete from answer where 1=1 limit 100;
end while;
end;
call bathInsertData();
DROP PROCEDURE bathInsertData;
1.首先确定好循环函数,因为数据量太多的话或开销大量的内存
2.调用循环体
3.删除循环体