clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3799264 fiddles created (41693 in the last week).

create table incidences ( start date, active int); insert into incidences values ('2020-08-02',1), ('2020-08-02',0), ('2020-08-02',0), ('2020-08-02',1), ('2020-08-03',1), ('2020-08-03',0), ('2020-08-03',1);
 hidden batch(es)


SELECT start as fecha, COUNT(IF(active = 0,1,NULL)) as 'active=0', COUNT(start) as total FROM incidences GROUP BY start;
fecha active=0 total
2020-08-02 2 4
2020-08-03 1 3
 hidden batch(es)