Попробуйте вот так:
with types(name, keyid)
as
(
select 'AAA', 1 from dual
union all
select 'BBB', 2 from dual
union all
select 'CCC', 3 from dual
),
phones(keyid, typeid, pname, status)
as
(
select 1, 0, 'Текст', 0 from dual
union all
select 1, 0, 'Текст', 0 from dual
union all
select 1, 0, 'Текст', 1 from dual
union all
select 1, 0, 'Текст', 0 from dual
union all
select 2, 0, 'Текст', 1 from dual
union all
select 2, 0, 'Текст', 0 from dual
union all
select 3, 0, 'Текст', 0 from dual
union all
select 3, 0, 'Текст', 1 from dual
union all
select 3, 0, 'Текст', 0 from dual
union all
select 3, 0, 'Текст', 1 from dual
)
-- Ваш запрос:
select
name,
sum(old),
sum(new),
count(status)
from
(select
t.name,
decode(p.status, 0, 1, 0) old,
decode(p.status, 1, 1, 0) new,
p.keyid,
p.status
from
types t
join
phones p
on p.keyid = t.keyid)
group by name
order by 1