Tuesday, April 30, 2013

How to count Null values in Oracle

How to count Null values in Oracle

                Oracle count function counts non-null values only.  If u want to count null values user can use  NVL function

Employees Table hr schema,  

Display Number of employees not getting Commission_pct.


SQL> select count(nvl(commission_pct,0)) from employees where commission_pct is null;

COUNT(NVL(COMMISSION_PCT,0))
----------------------------
                          72


Tags:How to count Null values in Oracle, counting null values in oracle, counting null values with nvl function.

No comments:

Post a Comment