数据库存储过程进行批量插入数据

BEGIN
#Routine body goes here...

#声明变量

DECLARE s INT;
DECLARE d INT;
DECLARE i INT;

#赋值
SET s=1568858400;
SET d=1;
SET i=55;
WHILE i<62 DO
BEGIN
INSERT INTO table_name(id, uid, sign_time, sign_period, day, created_at, updated_at) values(i,309,s,20190919,d,1569395237,1569395237);
SET s= s+96400;
set d= d+1;
set i= i+1;
END;
end WHILE;

END

猜你喜欢

转载自www.cnblogs.com/nothingc/p/11586157.html