我在学习MYSQL存储过程 课程时,自己手敲了一段代码,如下:
delimiter $$
create procrdure ttt( in end_num int )
BEGIN
DECLARE n int DEFAULT 0;
set n = 0;
WHILE n < end_num DO
set n = n + 1;
-- 很简单,就是个累加
END while;
select n ;
end $$
delimiter ;
但是一直会有报错,说我语法错误,我觉得应该是 WHILE 循环 或者 declare 语句报错,但是不知道到底错在哪:
> 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'procrdure ttt( in end_num int )
BEGIN
DECLARE n int DEFAULT 0;
set n = 0;
' at line 1
> 时间: 0s