【mysql】sql优化之存储过程(二)

前言

学习存储过程

实例

BEGIN
	#Routine body goes here...
	select id from t_user_info where id = n;
END

在这里插入图片描述

BEGIN
declare i int default 1;
start transaction; #开启事务
while i <= 1000000 do
insert into test_indexes 
values(i, concat("张天爱-", i), '测试字段', '测试字段', '测试字段',  '测试字段', '测试字段', '测试字段', '测试字段', '测试字段');
set i = i+1;
end while;
commit;
END

猜你喜欢

转载自blog.csdn.net/s1441101265/article/details/114982470