select serv_id ,acct_id,
(select sum(charge) from A where serv_id=?)
,sum(charge)
from A
where serv_id=?
group by serv_id,acct_id
(select sum(charge) from A where serv_id=?)
,sum(charge)
from A
where serv_id=?
group by serv_id,acct_id
from (select serv_id,acct_id,sum(charge) total_a from A where serv_id=? group by serv_id,acct_id) a,
(select serv_id,sum(charge) total_b from A where serv_id=? group by serv_id) b
where a.serv_id = b.serv_id
union
select '' as serv_id,'' as acct_id,sum(charge) from A