错误原因例如上图所示:这里大概率原因是因为我们粗心大意,在调用concat函数时没有在最后一个变量前加上逗号’,‘:
create procedure p7(in month int )
begin
declare result varchar(10);
case
when month >= 1 and month <=3 then
set result = '第一季度';
when month >= 4 and month <=6 then
set result = '第二季度';
when month >= 7 and month <=9 then
set result = '第三季度';
when month >= 10 and month <=12 then
set result = '第四季度';
else
set result ='非法参数';
end case;
select concat('您输入的月份为:',month,'所属季度为:'result);
end;