很多办法 select nvl(t.name,'空值') as name from student t select decode(t.name,null,'空值',t.name) as name from student t select case when t.name is null then '空值' else t.name end as name from student t
select decode(t.name,null,'空值',t.name) as name from student t
为空应该直接显示的是null吧,不用换啊.
如果是只想在查询出来的结果中不现实为空并且在原列上显示“提示信息”那么采用decode函数就可以实现 SELECT DECODE(t.name,null,'警告,此处为空值',t.name) AS name FROM student t. 但是如果想弹出警告框或者抛出异常信息需要在存储过程中通过exception实现
用case when啊, select case when t.name is null then '空!!!' else t.name end as name from student t。 我记得decode函数也行。你可以看看怎么做
select nvl(t.name,'空值') as name from student t
select decode(t.name,null,'空值',t.name) as name from student t
select case when t.name is null then '空值' else t.name end as name from student t
SELECT DECODE(t.name,null,'警告,此处为空值',t.name) AS name FROM student t.
但是如果想弹出警告框或者抛出异常信息需要在存储过程中通过exception实现
select case when t.name is null then '空!!!' else t.name end as name from student t。
我记得decode函数也行。你可以看看怎么做