在Navicat上连接MySQL,用while循环10次插入数据的语句
delimiter ;; #一定要加上,否则不能识别程序
drop procedure if exists test_insert; #判断删除已存在的程序
CREATE PROCEDURE test_insert () #创建程序
BEGIN
DECLARE i INT DEFAULT 0;
WHILE i<10 DO
insert into data_10KW (serial_number,xx,xxx) select serial_number,xx,xxx from data_1000W;
set i=i+1;
END WHILE;
COMMIT;
END;;
CALL test_insert();
本文介绍如何使用Navicat工具通过存储过程实现MySQL数据库中数据的批量插入操作。利用while循环进行10次数据插入,提高数据处理效率。
225

被折叠的 条评论
为什么被折叠?



