Is there any way to count null values in a column by using information_Schema tables? EG:
SELECT table_name, table_rows
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA ='myschema'
and table_name='mytable'
and table_rows is null;
Clarifications from comments:
I can not get the number of null values directly from the table as the table is large and not even returning the count of null values, so I thought information_schema
would be the best option to get count null values from table. But I don't know how to do this. Is there a way?
I have a table named cal
and one of its column contains null values. I just need to count the number of those null values. As table is large I cannot get result by using select count(*) from tablename where column_name is null
.
So I need a query which counts null values from Information_Schema somehow.
About the suggestion to add index:
But can I add an index on a column if
column_type = mediumtext
?
MySQL version 5.1.73 and table is MyISAM.