get counts of null and not null dates in mysql -
i have table in mysql named cfixed table shown below
i need counts of null , not null dates shown below
i have wrote mysql query getting count of not null , null dates shown below
for getting not null dates counts date not showing 0 count
select date, count(*) counts cfixed fixed not null group date   for getting null dates counts date not showing 0 count
select date, count(*) counts cfixed fixed null group date   can please tell me how counts of null , not null within single query
count() automatically counts non-null values (if provide specific column).
 null values can use conditional sum()
select date,         count(fixed) non_null_counts,        sum(fixed null) null_counts cfixed  group date      

Comments
Post a Comment