[Solved] What is returned when I count nulls?


What you do is use a conditional SUM

SELECT 
     SUM(CASE WHEN field IS NULL THEN 1 ELSE 0 END) as numNULL,
     SUM(CASE WHEN field IS NULL THEN 0 ELSE 1 END) as numNOT_NULL,
FROM table

EDIT

Sorry if i missunderstand your question. But your comment is very different to you original question.

http://www.w3schools.com/sql/sql_func_count.asp

SQL COUNT(column_name) Syntax
The COUNT(column_name) function returns
the number of values (NULL values will not be counted) of the
specified column:

In all plataform COUNT() should be 0.

You can use sqlFiddle to test your query in different database (MySql, SqlLite, MSSQL, Postgre, Oracle). Use the function Text to DDL to create the table very easy. Take consideration sometimes the site have some timeout so maybe need to try later

Here is mySQL http://sqlfiddle.com/#!9/413ea7/1

4

solved What is returned when I count nulls?