Oracle NVL空值处理函数

--NVL空值处理函数
--需求:显示价格表中业主类型ID为1的价格记录 如果上限值为null,则显示9999999
select nvl(null,0) from dual;
select * from t_pricetable
select nvl(maxnum,9999999) 
from t_pricetable
where ownertypeid=1;
--NVL2函数
select nvl2(null,0,1000) from dual;
select nvl2(20,10,100) from dual;
--需求:显示价格表中业主类型为1的价格记录 如果上限值为NULL,显示“不限”
select nvl2(maxnum,to_char(maxnum),'不限')
from t_pricetable
where ownertypeid=1;

 

posted @ 2018-11-21 20:09  学亮编程手记  阅读(489)  评论(0编辑  收藏  举报