mysql function 返回值问题,求解,在线等
create function func_get_other(i_date varchar(20),i_content varchar(100)) returns int(11)
begin
declare v_date varchar(20);
declare v_coutent varchar(20);
declare v_out int(11);
set v_date=i_date;
set v_coutent=i_content;
if substr(v_date,-4,2)='06' and v_coutent<>'' then
set v_out=2;
return v_out;
end if;
if substr(v_date,-4,2)='03' and v_coutent<>'1-3月' then
set v_out=1;
return v_out;
end if;
end
这段代码,为什么我调用的时候返回的都是0
执行select func_get_other('20130331','从1-3月'); 返回的结果是0,为什么是0,应该返回时1才对,求解