ประมาณนี้ปะครับ
select t1.name as clinic,sum(t1.cc) as cc from (select c.name,count(cm.hn) as cc
from clinic c
inner join clinicmember cm on c.clinic = cm.clinic
left join patient p on p.hn = cm.hn
where cm.clinic = "001" and p.chwpart = "43" and p.amppart = "08"
group by cm.hn
having count(cm.hn) = 1 ) as t1
union
select t2.name,sum(t2.cc) as cc from (select c.name,count(cm.hn) as cc
from clinic c
inner join clinicmember cm on c.clinic = cm.clinic
left join patient p on p.hn = cm.hn
where cm.clinic = "002" and p.chwpart = "43" and p.amppart = "08"
group by cm.hn
having count(cm.hn) = 1 ) as t2
union
select "คลินิกเบาหวาน DM, คลินิกความดัน HT",sum(t3.cc) as cc from (select c.name,count(cm.hn) as cc
from clinic c inner join clinicmember cm on c.clinic = cm.clinic
left join patient p on p.hn = cm.hn
where cm.clinic in ("001","002") and p.chwpart = "43" and p.amppart = "08"
group by cm.hn
having count(cm.hn) = 2 ) as t3