mysql function 返回值问题,求解,在线等

cenhimgn13 2014-01-03 06:06:38
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才对,求解
...全文
59 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

56,687

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧