oracle展现明细加小计合计
A 1 100
A 2 111
A 3 99
小计 310
B 1 100
B 2 110
B 3 90
小计:300
合计:610
------解决方案--------------------try
group by rollup(...)
------解决方案--------------------SQL code
select decode(grouping_id(c1,c2),1,'小计',3,'合计',c1),
c2,
sum(c3)
from t
group by rollup(c1,c2)