try:
select sum(a.12)
from a,b
where a.11=b.11
and a.14 = b.14
and a.15 = b.15
GROUP BY b.12
union all
select count(a.12)
from a,b
where a.11=b.11
and a.14 = b.14
and a.15 = b.15
GROUP BY b.13
order by a.20
select sum(a.12)
from a,b
where a.11=b.11
and a.14 = b.14
and a.15 = b.15
GROUP BY b.12
union all
select count(a.12)
from a,b
where a.11=b.11
and a.14 = b.14
and a.15 = b.15
GROUP BY b.13
order by a.20
select sum_12,con_12 from
(select sum(a.12) over(partition by b.12 order by rownum) sum_12,count(*) over(partition by b.13 order by rownum) con_12 from a,b
where a.11=b.11 and a.14 = b.14 and a.15 = b.15)