如何使用MySQL实现批量插入数据
如何使用MySQL实现批量插入数据
用存储过程,写个循环给你个我以前写的看看
begin
declare i int
declare b int
declare c int
set @i=2
set @b=6
set @c=0
set @stmt = concat(insert into t_j_goods_name (id,`code`,`name`)
values(?,?,(select distinct `a` from sheet1 limit ?, 1)))
while @i<442 do
prepare s1 from @stmt
execute s1 using @b,@i,@c
deallocate prepare s1
set @i=@i 1,@b=@b 1,@c=@c 1
end while
end