如何在Oracle/PLSQL中仅计算NULL值? [英] How can I count only NULL values in Oracle/PLSQL?

查看:164
本文介绍了如何在Oracle/PLSQL中仅计算NULL值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Oracle/PLSQL中仅计算NULL值?

How can I count only NULL values in Oracle/PLSQL?

我只想计算空值.有功能吗?

I want to count only the null values. Is there a function that does that?

推荐答案

我不是特别了解Oracle,但是ANSI SQL COUNT(rowName)不计算NULL值,而COUNT(*)可以.这样你就可以写

I don't know Oracle specifally, but ANSI SQL, COUNT(rowName) does not count NULL values, but COUNT(*) does. So you can write

SELECT COUNT(*) FROM YourTable WHERE YourColumn IS NULL

它计算YourTable中将YourColumn设置为NULL的行.

which counts the rows in YourTable that have YourColumn set to NULL.

这篇关于如何在Oracle/PLSQL中仅计算NULL值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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