insert into table select '张三',t.value from csvtodatatable('2019-1-1,2019-1-2') as t
csvtodatatable 是个 function ,自己实现一下 (传入 varchar(,分割) ,传出一个 table)
HENQIGUAI
2019-11-27 13:45:59 +08:00
```
delimiter || create procedure insertData() begin set @i = 0; set @time = now(); while @i<=100 do insert into demo (name,time)values(@i,@time); set @i = @i+1; set @time= date_add(@time, interval 1 day); end while; end || delimiter;