Oracle nal() 和count(*)的注意点
select count(*) into fhave from tab_ppxuser where name = userstr;
和
select nvl(hphotourl, '0') into photourl from tab_ppxuser where name = userstr;
这两条指令的方法count(*)和nvl(a,b)必须分开写,不然会报错,
方法nal()有两个参数,如nvl(a,b)
a时表的列元素名,b是个替代数据,理论上可以任意数据类型,可是我建议用varchar2的字符串,
当查询a返回的结果为null时,将会用b来赋值给结果,这样就可以避免了null返回值
本文来自博客园,作者:岑惜,转载请注明原文链接:https://www.cnblogs.com/c2g5201314/p/10534587.html
响应开源精神相互学习,内容良币驱除劣币

浙公网安备 33010602011771号