add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table someTable( ID int, guid varchar(2), entry varchar(2), cont int );
insert into someTable values(1,'g1','e1',null),(2,'g2','e2',null),(3,'g1','e1',null),
(4,'g3','e1',72345),(5,'g1','e3',null),(6,'g2','e2',34567)
select entry, count(*) as total_c,
sum(case when cont is not null then 1 else 0 end) as total_con,
sum(sign(ifnull(cont,0))) as total_cont2
from someTable
group by entry
entry total_c total_con total_cont2
e1 3 1 1
e2 2 1 1
e3 1 0 0