use world;
delimiter $$
create procedure a()
begin
declare x int default 1;
declare n int default 1;
declare y int default 0;
declare p varchar(2000) default '';
case
when x<=1000 then
while x<=1000 do
while n<=1000 do
if x%n=0 then set y=y+1;
else set y=y;
end if;
set n = n+1;
end while;
if y=2 then set p = p + '&' + cast(x as char);
else set y=2;
end if;
set x=x+1;
end while;
else set y=2;
end case;
select p ;
end $$
call a();
我尽了一切努力来找到错误。我发现很多在线资源都存在新的解决方案,但我想找出我的代码中的错误,以便我可以从错误中学习。