Click here to Skip to main content
15,905,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My query as follows;

SQL
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



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?
Posted
Updated 6-May-13 4:52am
v3
Comments
ZurdoDev 6-May-13 9:47am    
Did you try adding WHERE facname IS NOT NULL?

1 solution

Try this,

SQL
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900