关于mysql函数的问题
这是cc函数
BEGIN
declare sReturn int(1) DEFAULT 0;
select state into sReturn from sss where aperiod like left(date_,7);
if(sReturn = 1 or sReturn = 3) then
return 1; # 可以修改,删除与新增
else
return 2; # 不能修改,删除,新增
end if;
# return sReturn;
END
select cc(null) 可以正确的得出一个值为2
select cc(“”)也可以得出一个为2的值
但是select cc(time) from zz where id=2
该id=2的time栏位为空时查询出来的值为空
该id=2的time栏位为不为空时查询出来的值正确
不太明白