问题:
就相当指定一个ID一次性插入多条数据的SQL语句怎么写
回答1:
drop procedure if exists batchInsert_Test;
delimiter $$
create procedure batchInsert_Test()
begin
declare n int default 1;
declare MAX int default 10;
while n < MAX do
insert into t1(c1,c2) select c1,c2 from t1 where id=1;
set n = n + 1;
select sleep(1);
end while;
end
$$
delimiter ;
call batchInsert_Test();
drop procedure if exists batchInsert_Test;
回答2:
insert 。。。select .. 就可以啊。
insert into t_test(id,name) select "111",name from t_test where 1=1 ...
回答3:
看不懂你在说什么