select a.b_name,sum(case when b.sr_status = 'Y' then 1 else 0 end) as CNT_OPEN,
sum(case when b.sr_status = 'N' then 1 else 0 end) as CNT_CLOSE,
sum(case when b.sr_status in ('Y','N') then 1 else 0 end) as CNT_total
from branch a
left outer join service b
on a.b_id = b.b_id
group by a.b_name