问题
select distinct "column" from table;
output:
column
1 0.0
2 [null]
3 1.0
But when I try to count the null values
select count("column") from train where "column" is NULL;
Gives output 0 (zero)
Can you suggest where it's going wrong?
回答1:
Use count(*):
select count(*) from train where "column" is NULL;
count() with any other argument counts the non-NULL values, so there are none if "column" is NULL.
来源:https://stackoverflow.com/questions/53934294/how-to-count-null-values-in-postgresql