如何从sql查询结果中删除空行? [英] How to remove null rows from sql query result?

查看:166
本文介绍了如何从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

这篇关于如何从sql查询结果中删除空行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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