Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove null rows from sql query result?

I have a SQL query in which I am getting some records. Query is:

    select c.Id, c.FirstName, dbo.GetClientStaffContacts(c.Id, '27,31') as Staff from Client c order by c.Id

Result is: enter image description here

I want only those rows that are not having null values in column Staff.

Any help would be appreciated. Thank you.

like image 904
asma Avatar asked Jun 02 '11 07:06

asma


1 Answers

select 
  c.Id, c.FirstName, dbo.GetClientStaffContacts(c.Id, '27,31') as Staff 
from 
  Client c 
where
  dbo.GetClientStaffContacts(c.Id, '27,31') is not null
order 
  by c.Id
like image 66
heximal Avatar answered Sep 21 '22 01:09

heximal