select
H.kunde_id,
H.kunde,
A.abo_id,
H.abotyp_name,
count(A.abo_id)
from
Abwesenheit as A
join HeimlieferungAbo as H on A.abo_id = H.id
where
datum between '2020-10-01'
and '2021-09-30'
and H.abotyp_name <> ""
group by
abo_id with rollup