Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql count null

/*Writing an aggregated column
Assuming the column/field name is 'col'*/
SUM(CASE WHEN col IS NULL THEN 1 ELSE 0 END) count_nulls

/*OR*/

COUNT(*)-COUNT(col) count_nulls
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sql #count #null
ADD COMMENT
Topic
Name
3+5 =