如何在sqlserver中的行中获取'not null'或'null'列的数量 [英] How to get number of 'not null' or 'null' columns in a row in sqlserver

查看:147
本文介绍了如何在sqlserver中的行中获取'not null'或'null'列的数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想连续获取空列或非空列的数量.请帮助

I want to get number of null or not null columns in a row.Please help

推荐答案

Try:
Try:
SELECT COUNT(*) FROM MyTable WHERE myColumn IS NULL


还有


And

SELECT COUNT(*) FROM MyTable WHERE myColumn IS NOT NULL


请参考此模式

http://stackoverflow.com/questions/8596500/count- the-null-columns-in-a-row-in-sql [
Refer this pattern

http://stackoverflow.com/questions/8596500/count-the-null-columns-in-a-row-in-sql[^]


这篇关于如何在sqlserver中的行中获取'not null'或'null'列的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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