select aa.outdate,aa.outmoney,aa.outmoney2,
round(decode(aa.outmoney2, null,100, ((aa.outmoney-aa.outmoney2)/aa.outmoney2)*100),2)||'%' as huanbi
from (select to_char(a.inoutdate,'mm') as outdate,
round(nvl(sum( a.outmoney ),0),4) as outmoney,--本月出库额
(select round(nvl(sum( b.outmoney ),0),4) as outmoney2 from V_HOSP_MONTH_HB b
where to_number(to_char(b.inoutdate,'mm'))=to_number(to_char(a.inoutdate,'mm'))-1
group by to_char(b.inoutdate,'mm')
) as outmoney2--上月出库额
from V_HOSP_MONTH_HB a
where 1=1
group by to_char(a.inoutdate,'mm'))aa
order by aa.outdate ;