在数据库中,null值不会出现在输出中 [英] in database null values wont come in the output

查看:56
本文介绍了在数据库中,null值不会出现在输出中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查询如下;



My query as follows;

select Distinct Faculty_Name = (select top 1 facname from faculty f where facid = bfid and FacName = 'G. SEKHAR' and FacName <>'null'), Rating = (case rate when '1' then 'Excellent' when '2' then 'Good' when '3' then 'Fair' when '4' then 'Poor' when '0' then 'Not Applicable' end)  
  from facfeedback 





输出如下;





Output as follows;

Faculty_Name    Rating

 NULL	       Excellent
 NULL	       Fair 
 G. SEKHAR     Excellent
 G. SEKHAR     Fair







从我的下面我不想在下面输出中的Null值。

在我上面的代码中如何写代码中的空值不会显示在输出中

但我希望输出如下;






from my below i do not want the Null values in the below output.
for that in my above code how to write the code the null values wont be displayed in the output
But i want the output as follows;

Faculty_Name    Rating

  G. SEKHAR     Excellent
  G. SEKHAR     Fair 







为此我该怎么办?




For that how can i do?

推荐答案

试试这个,



Try this,

select Distinct Faculty_Name = (select top 1 facname from faculty f where facid = bfid and FacName = 'G. SEKHAR' and FacName is not null), Rating = (case rate when '1' then 'Excellent' when '2' then 'Good' when '3' then 'Fair' when '4' then 'Poor' when '0' then 'Not Applicable' end)
  from facfeedback


这篇关于在数据库中,null值不会出现在输出中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆