没测试过,不知道对不对select year,sum(decode(month,'1',sum_money)) sum1,sum(decode(month,'2',sum_money)) sum2...sum(decode(month,'12',sum_money)) sum12 from
(select year,month,sum(money) sum_money from 销售记录表 where year in('04','05') group by year,month)
group by year
union all
select year,sum(decode(month,'1',sum_money)) sum1,sum(decode(month,'2',sum_money)) sum2...sum(decode(month,'12',sum_money)) sum12 from
(select year,month,sum(money) sum_money from 销售指标表 where year = '05' group by year,month)
group by year