with t1 as
(
select 1 c1,'超市' c2 from dual
union all
select 2 c1,'医院' c2 from dual
union all
select 3 c1,'学校' c2 from dual
union all
select 4 c1,'酒店' c2 from dual
),t2 as
(
select 1 id,'希望小学' name,3 type from dual
union all
select 2 id,'人们医院' name,2 type from dual
)
select c2,count(id) c_num
from t1 left join t2 on t1.c1 = t2.type
group by c2