56,677
社区成员
发帖
与我相关
我的任务
分享
declare continue handler for sqlstate '02000' set _stop=1;
#声明一个游标后
declare cur1 cursor for select id from t_user;
open cur1;
fetch cur1 into _id;
while _stop<>1 do
#里面有子查询语句
select * from t_dept where 1=2;
fetch cur1 into _id;
end while;
close cur1;