这是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;
ENDselect cc(null) 可以正确的得出一个值为2
select cc(“”)也可以得出一个为2的值
但是select cc(time) from zz where id=2
该id=2的time栏位为空时查询出来的值为空
该id=2的time栏位为不为空时查询出来的值正确不太明白
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;
ENDselect cc(null) 可以正确的得出一个值为2
select cc(“”)也可以得出一个为2的值
但是select cc(time) from zz where id=2
该id=2的time栏位为空时查询出来的值为空
该id=2的time栏位为不为空时查询出来的值正确不太明白
解决方案 »
- 字符集的问题
- 安装的MYSQL For Windows V5.0.67 老是出现1045 access denied for user 'root'@localhost'
- 批量执行sql的问题
- windows2000服务器下的mysql数据导出 急死了
- 如何查询mysql单表中所有复制的记录?
- postgresql中游标不能这么用??
- Mysql中表一旦被改变,立即通知应用程序的问题
- [ERROR] Native table 'performance_schema' has the wrong structure
- select * from ceca_form_satpa where data_1 like '%%'为什么只能查出一条呢?
- 急急急
- mysqlbinlog 版本升级 ?
- MySQL执行存储过程中出现错误1305 - FUNCTION cr_debug.ENTER_MODULE2 does not exist
但是select cc(null)||select cc("")又是有结果的,我只是不明白,zz.time=“”或者.zz.time is null 的时候,用select cc(zz.time)和select cc(null) || select cc("")有什么区别,为什么他们得出的结果不一样