select * from Kunde k
left join DepotlieferungAbo depAbo on k.id = depAbo.kunde_id
left join HeimlieferungAbo heiAbo on k.id = heiAbo.kunde_id
left join PostlieferungAbo posAbo on k.id = posAbo.kunde_id
where depAbo.start between ‘2010-01-01’ and ‘2010-12-31’
or heiAbo.start between ‘2010-01-01’ and ‘2018-12-31’
or posAbo.start between ‘2010-01-01’ and ‘2010-12-31’

select k.id, k.bezeichnung, depAbo.start as depstart, depAbo.ende as depende, depAbo.anzahl_abwesenheiten as depanzhal, heiAbo.start as heistart, heiAbo.ende as heiende, heiAbo.anzahl_abwesenheiten as heianzhal, posAbo.start as poststart, posAbo.ende as postende, posAbo.anzahl_abwesenheiten as postanzhal from Kunde k
left join DepotlieferungAbo depAbo on k.id = depAbo.kunde_id
left join HeimlieferungAbo heiAbo on k.id = heiAbo.kunde_id
left join PostlieferungAbo posAbo on k.id = posAbo.kunde_id
where depAbo.start between ‘2010-01-01’ and ‘2019-12-31’ and depAbo.ende between ‘2010-01-01’ and ‘2019-12-31’
or heiAbo.start between ‘2010-01-01’ and ‘2018-12-31’ and heiAbo.ende between ‘2010-01-01’ and ‘2010-12-31’
or posAbo.start between ‘2010-01-01’ and ‘2010-12-31’ and posAbo.ende between ‘2010-01-01’ and ‘2010-12-31’

select a.id, a.name, count(depAbo.id), count(heiAbo.id), count(posAbo.id), count(zuAbo.id) from Abotyp a
left join DepotlieferungAbo depAbo on a.id = depAbo.abotyp_id
left join HeimlieferungAbo heiAbo on a.id = heiAbo.abotyp_id
left join PostlieferungAbo posAbo on a.id = posAbo.abotyp_id
left join ZusatzAbo zuAbo on a.id = zuAbo.abotyp_id
where depAbo.start between ‘2010-01-01’ and ‘2010-12-31’ and depAbo.ende between ‘2010-01-01’ and ‘2010-12-31’
or heiAbo.start between ‘2010-01-01’ and ‘2018-12-31’ and heiAbo.ende between ‘2010-01-01’ and ‘2010-12-31’
or posAbo.start between ‘2010-01-01’ and ‘2010-12-31’ and posAbo.ende between ‘2010-01-01’ and ‘2010-12-31’
group by a.name