先提一个问题,怎么MySQL不能写 create or replace ?
CREATE PROCEDURE `soft`.`new_procedure` (in b int,in a int)
BEGIN
declare c int;
if a is null then
set a = 0;
end if;
if b is null then
set b = 0;
end if;
if b>5 then set b = 0;
elseif b<0 then set b = 1;
else
set b = a;
set @tmp=1; #这个是什么意思,不要竟然还不行
end if;
set c = a + b;
select c as sum;
end
CREATE PROCEDURE `soft`.`new_procedure` (in b int,in a int)
BEGIN
declare c int;
if a is null then
set a = 0;
end if;
if b is null then
set b = 0;
end if;
if b>5 then set b = 0;
elseif b<0 then set b = 1;
else
set b = a;
set @tmp=1; #这个是什么意思,不要竟然还不行
end if;
set c = a + b;
select c as sum;
end