RT:
    例如:select  t.name from student t
       查询 t.name 的时候对t.name 进行为空验证 如果不为空值还是原值,为空就给出相应提示信息。

解决方案 »

  1.   

    很多办法
    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
      

  2.   

    select  decode(t.name,null,'空值',t.name) as name from student t
      

  3.   

    为空应该直接显示的是null吧,不用换啊.
      

  4.   

    如果是只想在查询出来的结果中不现实为空并且在原列上显示“提示信息”那么采用decode函数就可以实现
    SELECT  DECODE(t.name,null,'警告,此处为空值',t.name) AS name FROM student t.
    但是如果想弹出警告框或者抛出异常信息需要在存储过程中通过exception实现
      

  5.   

    用case  when啊,
    select  case when t.name is null then '空!!!' else t.name end as name from student t。
    我记得decode函数也行。你可以看看怎么做