Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

how to count null values in mysql

# to get the count of total null values of your sql table's column
SELECT COUNT(*) as num
FROM table
WHERE colname IS NULL;

# to get the count of total non-null values of your sql table's column
SELECT COUNT(*) as num
FROM table
WHERE colname IS NOT NULL;
Source by buggyprogrammer.com #
 
PREVIOUS NEXT
Tagged: #count #null #values #mysql
ADD COMMENT
Topic
Name
4+9 =