如何计算SQL Server 2005中表的任何特定列中的空白? [英] How to Count blanks in any particular column of table in sql server 2005?
本文介绍了如何计算SQL Server 2005中表的任何特定列中的空白?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何计算sql server 2005中表的任何特定列中的空白?
How to Count blanks in any particular column of table in sql server 2005?
推荐答案
SELECT COUNT(Column_Name) FROM TableName WHERE ltrim(rtrim(Column_Name)) = ''
希望这会有所帮助!
Hope this helps!
以下查询应该为您完成这项工作.
Following query should do the job for you.
select count(*)
from tableName
where (columnName is null or columnName = '')
希望能有所帮助.如果是这样,请将答案标记为解决方案和/或认可.
谢谢
Milind
Hope that helps. If it does, mark answer as solution and/or upvote.
Thanks
Milind
这篇关于如何计算SQL Server 2005中表的任何特定列中的空白?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文