如何从sql查询结果中删除空行?
问题描述:
我有一个 SQL 查询,其中获取了一些记录.查询是:
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
结果是:
我只想要那些在 Staff 列中没有空值的行.
I want only those rows that are not having null values in column Staff.
任何帮助将不胜感激.谢谢.
Any help would be appreciated. Thank you.
答
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